hi,
I was just wondering if there was a simple way of converting a string to all capital letters ??? eg a single for loop .... ?????
Thank you for your time
Craig
hi,
I was just wondering if there was a simple way of converting a string to all capital letters ??? eg a single for loop .... ?????
Thank you for your time
Craig
Simple enough?Code:for ( size_t x = 0; x < strlen ( a ); x++ ) a[x] = toupper ( a[x] );
-Prelude
My best code is written with the delete key.
>is there a difference between size_t and int?
Yes, size_t is what strlen returns and size_t is usually defined as an unsigned type, thus causing a type mismatch in your loop condition if the counter variable is a regular int.
-Prelude
My best code is written with the delete key.
there is also a strupr() in string.h which does that in 1 line.
-
>there is also a strupr() in string.h which does that in 1 line.
strupr isn't a standard function as far as I know.
-Prelude
My best code is written with the delete key.
>>strupr isn't a standard function as far as I know.
Hmmm, thought that it was, but then everybody says that you are the MAN
-
>everybody says that you are the MAN
Actually everybody says shes the WOMAN....
>>Actually everybody says shes the WOMAN....
dude i've seen a lot saying "PRELUDE'S DA MAN"
and i think she'll agree.
-