4 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for JohnMcPherson

I am having a problem with reading input data after checking a position marker in the data file. The code that does the reading follows: fip = fopen("fprmf.txt","r"); . . . strcpy(passw,"P7"); fscanf(fip, "%3s", ckod); /* card # 164 */ fprintf(ff16,"\n\n%12s%12s\n", "card# 164 :", "Password "); printf("passwd is %s\n", ckod); …

Member Avatar for Nutster
0
798
Member Avatar for JohnMcPherson

I am trying read CSV files in a C program on an AIX system. I am having problems getting fscanf to recognize the comma delimeter. I have read previous posts on this issue, and used the techniques dicussed in those threads, but I am still having the issue. Specifically, this …

Member Avatar for JohnMcPherson
0
6K
Member Avatar for vikingsheepman

Hello all! I have used this forum many times in the past to solve a variety of programming related problems, but am truly stumped on a segfault within a binary search tree. I have isolated the segfault to a fscanf statement that look legitamate to me. The following code blocks …

Member Avatar for vikingsheepman
0
262
Member Avatar for mcjiwe

main.c #include <stdio.h> #include <stdlib.h> #define MAX_USERS 100 typedef struct Utilizadores{ char *login; char *pwd; } USERS; void ReadUsers(USERS user[]); int u = 0; int main(){ USERS user[MAX_USERS]; ReadUsers(user); return 0; } void ReadUsers(USERS user[]){ FILE *fp; fp = fopen("/home/Jiwe/Desktop/users.txt", "r"); while(fscanf(fp, "%s[^=]=%s\n", user[u].login, user[u].pwd) != EOF){ u++; } fclose(fp); …

Member Avatar for mcjiwe
0
8K

The End.