Severity Code Description Project File Line Suppression StateError C2059 syntax error: '==' Project25 c:\users\yi cian\documents\visual studio...
Type: Posts; User: kkkcj
Severity Code Description Project File Line Suppression StateError C2059 syntax error: '==' Project25 c:\users\yi cian\documents\visual studio...
and i should put the findStaffbyid in the beginning of the modify code or last?
after that it show red underline on == say excepted a field name sry for all the question...i really not good at programming
ohhh...i see and for
staff *findStaffById(staff *staffObj, int id) {
int found = 0;
FILE *fp = fopen("staff.dat", "rb");
if (!fp) {
return NULL;
}
while...
which mean i should not use staff P[20]; right?
i got it..i intent to to keep reading the file whenever you want to access the data
and
void modifyStaff() {
char ans, cont, name[25], position[20];
int i = 0, pCount, modiCount = 0,...
void addStaff()
{
struct staff staa;
char ans;
FILE *fp;
fp = fopen("staff.dat", "ab");
but i'm declare the salary as the integer type ...i'm not sure which part you refer to and after i change the code become (id == P[i].id ) the compiler will straight print no record founded with this...
if(id == P[i].id ==0){
found =1;
this is mean if the id user enter same as id store in system. print all the details and another question is the compiler will display the details even...
typedef struct staff {
int id, salary;
char name[30], position[30];
}staff;
void modifyStaff() {
char ans, cont, name[25], position[20];
int i = 0, pCount, modiCount = 0, found, id[20];...
void modifyStaff() {
char ans, cont, name[25], position[20];
int i = 0, pCount, modiCount = 0, found, id[20];
int salary[20];
staff P[20];
FILE*fp;
fp = fopen("staff.dat", "rb");
while...
i misunderstand it...i get it now...is the salary...
which mean i should use =?
and it will not change the original data..for example i modify the name kkk to become yyy, it still show the kkk instead of yyy
void modifyStaff() {
char ans, cont, name[25], position[20];
int i = 0, pCount, modiCount = 0, found, id[20];
int salary[20];
staff P[20];
FILE*fp;
fp = fopen("staff.dat", "rb");
while...
thank u very muchhh....there another question..it will only execute until the line 21...it wont execute the remain row
typedef struct staff {
int id,salary;
char name[30], position[30];
}staff;
void modifyStaff() {
char ans, cont, staid[20], name[25], position[20];
int i = 0, pCount, modiCount = 0,salary,found;
staff P[20];
FILE*fp;
fp = fopen("staff.dat", "rb");
...
int main(void)
{
int flag = login();
if (flag == LOGIN_SUCCESSFUL)
menu();
else
printf("flag %d\n\n", flag);
enum
{
LOGIN_SUCCESSFUL = 0,
LOGIN_FAILURE_WRONG_PASSWORD = -23,
LOGIN_FAILURE_NO_SUCH_USER = -44
};
int login()
{
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int login()
{
char username[15];
char password[12];
printf("Enter your username:\n");
i try..but if user name and password both correct it only show the Welcome.Login Success and won't show the menu
and make the password display as ***
login()
{
char username[15];
char password[12];
printf("Enter your username:\n");
scanf("%s", &username);
no..i'm using %s