B
Bill Cunningham
Mark McIntyre said:You can't compare strings with ==
The code above compares the addresses of name and name2, to see if
they're equal (which, obviously, they aren't).
You must use strcmp or one of its fellows.
Mark,
I haven't got to the functions used in the string.h header yet. The tutorial
at
http://www.eskimo.com/~scs/cclass/
has helped me more than any other. You pick up little things like int c is
not as good as int c=0 because int c is bound to contain garbage if not
initialized to something. That's better than just references functions from
a book you really haven't studied yet. I have been away from C for around a
year.
This is how I tried to use the function.
int c=0;
c=strcmp(name,name2);
Like I say I will have to probably come to this function in the turtorial I
don't want to ask someone to do my homework for me but what good is a C
community if you don't participate. Aspiring amateur programmers probably
I'm sure get on the nerves of professionals. I need to know how to use this
with if ().
I have major depression and panic attacks to the point of convulsive
problems and being drawn up in the floor.
This hinders concentration, retention, and attention. Klonopin has an affect
of confusing its patient.
Bill