2
Contributors
1
Reply
3
Views
6 Years
Discussion Span
Last Post by Adak
1

Pretty much the same way you find your shoes in the morning:

1) scan the floor, find the left shoe
2) scan some more floor, find the right shoe.

Check if the strings are the same, about the same way you see if your shoes are a matching pair:

1) same color
2) same size
3) same style

How would you check if "this string", was the same as "that string"?

1) same letter, in the same place, in two char array's
2) all the way to the end of the string.

strcmp() will do this, but if you want to learn how to program, why not "roll your own" here, and learn a bit.

strchr() will check a string for a left parentheses, and then you can ask it to check a string for a right parentheses.

For both the above, include the string.h file.

Using fgets() to put each row of text to be scanned, into a char array, should be perfect for your purposes.

fgets(NameOfBuffer, sizeof(Buffer), filePointerORstreamName);
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.