in the first part is the Main Menu. after it is the sub-menu if you choose 'A'..
on that sub-menu i have trouble accessing my structured data type struct clients. what do i have to do?
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <conio.h>
#include <string.h>
struct clients{
char fName[15];
char uName[10];
char pWord[10];
int dJoined[10];
int dEntry[10];
int tEntry[8];
char journal[];
};
int main(){
printf("MAIN MENU\n[A] New User\n[B] Old User\n[C] Quit\n\n");
ch = getche();
ch = toupper(ch);
while(ch=='A'||'B'||'C'){
if(ch=='A'){
FILE *cfPtr;
if((cfPtr=fopen("users.txt","w"))==NULL){
printf("File could not be opened\n");
}
else{
printf("\nEnter the Full Name\nUser Name\nPassword\nDate Joined.\nEnter EOF to end input.\n");
printf("-");
scanf("%s%s%s%d", clients.fName, clients.uName, clients.pWord, clients.dJoined);
while(!feof(stdin)){
fprintf(cfPtr, "%s* %s* %s* %d*\n", fName, uName, pWord, dJoined);
printf("-");
scanf("%s%s%s%d", &fName, &uName, &pWord, dJoined);
}
fclose(cfPtr);
}
}
}
}
i also got this error messages..
G:\proj.cpp expected primary-expression before '.' token

New Topic/Question
Reply



MultiQuote





|