-1
因此,我正在嘗試讓用戶登錄的ac程序。我有一個csv文件,列出當前註冊用戶,如下所示:全名,用戶名,密碼。CSV文件嘗試獲取每行後第一個逗號後的項目
我想讓用戶輸入他們的用戶名和密碼,然後掃描csv文件中的每一行並查找匹配,如果行中沒有匹配,那麼程序將掃描下一行,直到文件結尾..但我堅持如何編碼。到目前爲止,我有:
#include <stdio.h>
#include <stdlib.h>
int main() {
FILE *fp = fopen(Members.csv, "r");
fgets(user, 100, stdin);
fgets(pass, 100, stdin);
while (!feof(fp)) {
char username[];
char password[];
//trying to use a loop to go through each row and see if there are any matches
您的源代碼似乎突然結束。 – abligh 2014-11-23 18:56:48