| SM Ryan 2005-11-16, 8:48 pm |
| darkchild50@gmail.com wrote:
# Q1. i have found a good number of directory display programs but cant
# seem to fiugre out how to find a file useing a simmalir program. any
# ideas.
You might want to include at least partial code.
# Q2. im trying to impliment a program that looks in a file for a list of
# usernames and passwords in the format
# username1 password1
# username2 password2
# ect.
# the code i wrote to do this is:
#
# #include <stdio.h>
#
# int main(){
# FILE *fp;
# char ch;
#
# fp = fopen("users.cfg", "r");
# ch = fgetc(*fp);
# while(ch != EOF){
# while(ch != " "){
You're comparing a character to a string address. To get the
character codes of space and newline use single quotes,
' ' and '\n'. You might want to review the distinction of
single and double quotes in C.
# /* this part needs to add th char ch to a string usrn*/
# }
# while(ch != "\n"){
# /* this part needs to add th char ch to a string pass*/
# }
# }
# }
--
SM Ryan http://www.rawbw.com/~wyrmwif/
I think that's kinda of personal; I don't think I should answer that.
|