"Bill Cunningham" <no****@nspam.comwrote in message
news:eSegj.5898$Xo1.2521@trnddc06...
Wait a minute I think I might've just caught my problem. It's in the
function body where I'm making the error. Not assigning name[] to anything
in the body. What about this.
char passw(char name[])
{char i=name;
....
if (strcmp(i,name2)==0) {printf"ok");}
else if(strcmp(i,name2)!0) {puts("unequal rtry again"); return
passw();}
'char *s=name;', would be ok.
'char i=name;' has 2 problems:
'char i;' is an integer type, not a string;
via common practice/tradition, many names have certain reserved meanings and
usages, and you have just violated one of the major ones...
i, j, and k, are almost universally defined, if present, in any function or
context, to be integers...
l, is, most of the time, an integer.
so, j, j, k, and l, should not be declared as anything other than 'int'.
s and t, are commonly, but not as strongly or universally, reserved for
strings.
f, g, and often h, are usually reserved for floats.
p, q, and sometimes r, are often used for generic pointers (usually 'void
*').
there are many such conventions, but going too much into specifics tends to
quickly become programmer/project/codebase specific...
there have been more than a few papers written on the topics of variable
naming and code indendation/formatting, and one should try to at least try
to adhere to the common conventions unless there is some good reason to do
otherwise.
note that the C, C++, and Java communities tend to have different practices
wrt indentation and naming (though, afaik, the i,j,k convention is almost
universal).
but, in any case, there are conventions for these things...
Bill