Archive for April 25, 2008
It's my Birthday!!!
4
![]()
Do you know what’s special today???
Yes! its my 25th Birthday. Its a bit more special.
Its the first and last b’day on which my age and day are the same – 25!!!
Its too late now. But i’m in a good mood to tell some stories. Do you know that the number 25 is special to me. Might be a coincidence – this blog took birth on March 25th. And more over that, my fathers birthday is on March 25th. My first b’day after starting this blog, which is on 25 – made me 25 years old. I’m pretty imaginative. huh?
Do you know, whats the inspiration for me to start this blog? I was an ordinary guy who finish my work and reach home early. One day as a part for technical activities, my project lead asked me to send technical tips to group members. But one condition – One tip per day! To be honest, at first – i tried to escape, because i felt its a burden.
From next day onwards, i searched the net for Visual C++ tips, found a lot, i copied and send it to team members as mails. But later on, i realize that the thing which i felt as a burden is slowly becoming a passion. I’m learning a lot, my technical skills are getting sharpened. I stopped the art of copy-pasting and began to work hard and find interesting tips myself. (None of the items in this blog are copy-pastes
) I began to dig MSDN during late nights. Began to read a lot of books and articles out of them, searching for a spark for an innovative idea. Still the quest goes on…
Then several other persons requested me to include them in the mailing list for daily tips. The list began to grow! After that i got onsite assignment to Europe and the daily tips was stopped for a while. Now after coming back, i though of restarting it even more stronger. And thats how this blog took birth. previously only a group of persons enjoy my tips, now by being online, it reach all over the world! If any of my efforts made your life easier, then i am happy that my efforts have meaning!
I’ll continue my quest – quality tips per day. Watch on and thanks for all visitors who motivates me by visiting frequently and by listining me. Thanks For all your support!
For WeSeeTips
Jijo.
STL valarray – An easy way to manipulate values.
0![]()
Assume you need to find the sum of 100 integers. You can create an array or use some STL containers, fill the values and by iterating you can find the sum. Instead of that you can use valarray container for storing any value type and do a number of mathematical operations for all items in just a function call.
![]()
See the code snippet for how to use valarray.
// Integer array of 10 members.
valarray<int> IntegerArray( 10 );
// Filling the array.
for( int nIndex = 0; nIndex < 10; ++nIndex )
{
IntegerArray[ nIndex ] = nIndex;
}
// I need to get the sum of all number.
int nSum = IntegerArray.sum();
If you want to manipulate bulk amount of numbers, better use valarray.
![]()
The valarray contains only sum() and misc functions are its member function. Still they are useful, if you want to keep bulk amount of numerals.
![]()
Targeted Audience – Beginners.