Hi
Right Now im just experimenting with c++. This basic program has keyboard input..and converts it to uppercase (just for the fun of it):-
Code:
//String Experiment and ideal of array understanding
#include <iostream>
#include <cctype>
#include <cstring>
using namespace std;
int main () {
char str[60];
int i;
cout << "\nPlease Enter A String For Conversion: ";
gets(str); //Keyboard Input
for(i = 0; str[i]; i++) str[i] = toupper(str[i]);
cout << "toupper() Conversion: " << str << "\n";
return 0;
}
However when I execute it it gives me the following warning:
warning: this program uses gets(), which is unsafe.
Is this normal?..
So far I havnt experienced any stability issues with the gets() and the compiler doesnt have any warnings or errors
Is there any alternative to gets()..i know cin..but I want to be able to have spaces and tabs etc
Thanx For The Heads Up In Advanced!
Cheers
Alex