All pastes #20866 Raw Edit

Stuff

public c v1 · immutable
#20866 ·published 2005-08-23 15:03 UTC
rendered paste body
#include <stdio.h>#include <stdlib.h>#define MAX_LINE 50#define OFF_END -2int main(){	FILE * file;	long fsize;	char * buffer;	file = fopen("map01.map","r");	if (file!=NULL) {		char *s;		char *p;		s=p=(char *)malloc(MAX_LINE);		while( ((*p=getc(file))!='\n') && (p<(s+OFF_END))) {			p++;		}		*p='\0';		p=s;		while( ((*p=getc(file))!='\n') && (p<(s+OFF_END))) {			p++;		}		printf("%s\n",s);		fclose(file);		free(buffer);		return 0;	}}