try this:
Code:
#include<iostream>//remove '.h', it might still work, but it's not a good habit
#include<string>//strings just make life much easier. let's use them
int main () {//once again, a matter of compilers, but most want you to specify that main is an int
string input;//the string class is much more fun than char arrays or chars
cin.getline(input, 100);
/*the above function reads from cin and stores it in input until 100
characters have been read, or until there's a new line (pressing enter)*/
if (input[0]=='/' && input[1]!='\') {
/*checks if the first character in input is '/', but makes sure the
second char isn't another slash. that would mean the wrong 'if'
was being used*/
cout<<"/Syntax error";
}
else if (input[0]=='/' && input[1]=='/') {
/*makes sure that both of the first two chars are slashes. kind of hackish, but it works*/
cout<<" ";
}
return 0;
}
hope this helps