quick question, would this code be considered fully c++ or fully c? I've never learned c, but I believe that sscanf (c) is similar to cin (c++), but I'm not sure....
Code:
ifstream examplefile(argv[1]); //open a file indicated by the single command
//line argument
if (! examplefile.is_open())
{
cout << "Error opening file"; exit (1);
}
examplefile.getline (buffer,100);
sscanf(buffer,"%d", &line);
cout << line << endl;
for (i=1; i<=line; i++)
{
examplefile.getline (buffer,100);
sscanf(buffer, "%d, %d", &con1, &con2);
cout << con1 << "," << con2 << endl;
}
thanks, axon