Latest code
Code:
#include <iostream.h>
#include <stdio.h>
#include <fstream.h>
#include <string.h>
#include <conio.h>
char blank[]=" ";
class mainbot
{
public:
mainbot::mainbot();
~mainbot();
int userintf();
int checkinput();
int checkoutput();
private:
char inp[75];
int inpno;
char responce[75];
char inchk[75];
int inchkcnt;
char str[500];
};
mainbot::mainbot()
{
}
mainbot::~mainbot()
{
}
int mainbot::userintf()
{
cin.getline(inp,75);
checkinput();
checkoutput();
cout << responce;
return 0;
}
int mainbot::checkinput()
{
ifstream input("input.txt");
input >> str;
inchkcnt=1;
while(strcmp(inchk,blank)||!strcmp(inchk,inp))
{
strtok(str, inchkcnt);
cout << "hello";
strcpy( inchk, strtok(NULL, inchkcnt) );
inchkcnt++;
}
if(!strcmp(inchk,blank))
{
cout << "I don't understand." << endl;
}
else
{
input.close();
checkoutput();
}
}
int mainbot::checkoutput()
{
ifstream output("output.txt");
output >> str;
strtok(str, inchkcnt);
strcpy( responce, strtok(NULL, inchkcnt) );
output.close();
}
int main()
{
mainbot interf;
interf.userintf();
return 0;
}
Latest Bugs:
Code:
E:\PROGRAMS\Projects\Tests\Chat Bot\notafriend\nofsource.cpp(45) : error C2664: 'strtok' : cannot convert parameter 2 from 'int' to 'const char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
E:\PROGRAMS\Projects\Tests\Chat Bot\notafriend\nofsource.cpp(46) : error C2664: 'strtok' : cannot convert parameter 2 from 'int' to 'const char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
E:\PROGRAMS\Projects\Tests\Chat Bot\notafriend\nofsource.cpp(63) : error C2664: 'strtok' : cannot convert parameter 2 from 'int' to 'const char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
E:\PROGRAMS\Projects\Tests\Chat Bot\notafriend\nofsource.cpp(64) : error C2664: 'strtok' : cannot convert parameter 2 from 'int' to 'const char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast