by teh way guys , does any one know why this doesnt work?
Code:
#include <cstdlib>
#include <iostream>
#include "linescanner.h"
#include <string>
#include <cctype>
#include <cstring>
using namespace std;
int main(int argc, char *argv[])
{
int choice = 0, found1=0, check=0, found2=0;
string str ("loop : RED X num");
char * cstr;
int k = str.length();
char c;
found1=str.find(" X ");
found2=str.find(" : ");
cstr = new char [str.size()+1];
strcpy (cstr, str.c_str());
c = cstr[k-1];
if ( found1 !=-1 ) //if the " X " is found then proceed to the next step
{
if (found2 !=-1) //if " : " (the colon is found ) then >> next step
{
cout<<"found "<<found2<<endl;
if (isalpha(c))
{
check = 15;
cout<<"check"<<check;
//return 15; //its a command with X and string offset ( RED X num)
}
}
}
cout<<check;
system("PAUSE");
return EXIT_SUCCESS;
}