Sorry about my last post!!!
Most things that gets into my mind the first time usually donīt work, so here is some code that actually works!!
Eaven though it may not be the best example..
#include <iostream>
using namespace std;
int main()
{
const int uc_start = 65;
const int uc_end = 90;
const int size = 1000;
char bText[size] = "Hello There, You Supreme C++ Programmer";
char upperCase[size];
int i = 0,j = 0;
for (i = 0;bText[i] != '\0';i++)
{
if ( (int)bText[i] >= uc_start && (int)bText[i] <= uc_end )
{
upperCase[j] = bText[i];
j++;
}
}
upperCase[j] = '\0';
cout << endl;
cout << "The UpperCase characters in bText[] is: " << flush;
cout << upperCase << endl;
return 0;
}
I remembered that I forgot!!
I forgot the code tags!!
Code:
#include <iostream>
using namespace std;
int main()
{
const int uc_start = 65; // upper case chars starts at this (int) value
const int uc_end = 90; // upper case chars starts at this (int) value
const int size = 1000;
char bText[size] = "Hello There, You Supreme C++ Programmer";
char upperCase[size];
int i = 0,j = 0;
for (i = 0;bText[i] != '\0';i++)
{
if ((int)bText[i] >= uc_start && (int)bText[i] <= uc_end)
{
upperCase[j] = bText[i];
j++;
}
}
upperCase[j] = '\0';
cout << endl;
cout << "The UpperCase characters in bText[] is: " << flush;
cout << upperCase << endl;
return 0;
}