ok I haven't programed in a while and I never had much luck with the string.h library so this is prolly the dumbest thing ever but here it goes I am making a simple input program for a logic prgram I am going to be making later and I keep getting incompatible type and invalid conversion from int errors and I have no idea what I did wrong most of the errors are in the strcmp functions. Thanx
Code:
#include <iostream.h>
#include <stdlib.h>
#include <string.h>
#include <fstream.h>
char name[9];
char filename[9];
int input();
int main()
{ int yesno;
cout<<"Logic.";
cout<<"Please enter your username (less then 4 letters):";
strcpy(filename,name);
filename=strncat(filename,".txt", 4);
ifstream file(filename);
if (!file)
{file.close();
cout<<"I'm sorry but you either typed your name in wrong or haven't used the program before.\n";
cout<<"Would you like me to create a New account? (y/n): ";
cin>>yesno;
if (strcmp (yesno, "n") != 0 || strcmp (yesno, "N") != 0)
{cout<<"ok then thank you;";
system("PAUSE");
return 0;
}
if (strcmp (yesno, "y") != 0 || strcmp (yesno, "Y") != 0)
{ofstream a_file("example.txt");
cout<<"\n Your File Has been successfully created!";
input();
}
return 0;
}