Hi,
Here is my code :
#include <string>
#include <ctype.h>
#include <iostream>
using namespace std;
int main()
{
int i,j,k;
char *string = "hello.my name is Joe. what is your name?";
// length = strlen(string);
for (i = 0; i < 1; i++)
{
if ((string[i] >= 'a') && (string[i] <= 'z'))
{
string[i] = toupper(string[i]);
}
}
for (j = 6; j < 7; j++)
{
if ((string[j] >= 'a') && (string[j] <= 'z'))
{
string[j] = toupper(string[j]);
}
}
for (k = 22; k < 23; k++)
{
if ((string[k] >= 'a') && (string[k] <= 'z'))
{
string[k] = toupper(string[k]);
}
}
cout<<"%s\n"<<string;
//printf("%s\n",string);
return 0;
}
This code works perfectly fine in Turbo C, but when i compile it through Visual C++, it does'nt gives any error, but when i execute the program , the output is not shown , n message appers ... "This program has caused an error , it will close "
Can anybody help me fix this problem.
Thanxs.