Discussion Locked
0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
The Nov. 25, C++ TechMail discusses '_if' counterparts in the Standard Template Library (STL). How do you handle the inconsistent use of '_if' counterparts in STL? Will this tip help you in your future C++ programming?
2 replies
I received this suggestion in an e-mail.
Instead of:
int aTest[] = { 3, 6, 1, 30, 4, 7, 20, 3, 34, 2, 66 };
int nCount = sizeof( aTest) / sizeof( int);
do:
int aTest[] = { 3, 6, 1, 30, 4, 7, 20, 3, 34, 2, 66 };
int nCount = sizeof( aTest) / sizeof( aTest[0]);
You remove the type dependence.
Anyone care to comment?
by john torjo
Hi,
Thanks for pointing it out!
I usually do it exacly the way you said it. Being just an example, I must have forgotten... I'll be more careful in the future.
Best,
John
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending
Discussion Locked
What Makes a Business Website Effective in 2026
2 helpful
10 replies
1 helpful
3 replies
Question
Windows and macOS computers becoming slow or unstable after updates - what should I check first
0 helpful
1 reply
Question Unanswered
Best Way to Make Long WordPress Location Guides Mobile Friendly
0 helpful
0 replies
Discussion
Optimizing WordPress widgets and DOM size
0 helpful
3 replies