Quick actions

cmd+k|ctrl+k

Navigation

Languages

Multi-file test

Snippet info

Language

C

Visibility

public

Author

imlinhanchao

Created

2020-07-12T07:36:33Z

Updated

2020-07-12T07:37:23Z

#include <stdio.h>
#include <string.h>
#include "add.h"

int main(void) {
    char buf[20] = "";
    int nSize = 0;
    FILE* fp;
    fp = fopen("some.txt", "r");
    while(1)
    {
		memset(buf, 0, sizeof(buf));	
		int rc = fread(buf, sizeof(char), sizeof(buf) - 1, fp);
		if (rc <= 0)
			break;
		printf("%s", buf);
    }
    fclose(fp);
    printf("\n");
    printf("1 + 2 = %d\n", add(1,2));
    return 0;
}
INFO