tmpl=(char*)malloc(512); int f=fopen("template_file","r"); u_int row=0; for(int i=0;i<4000;i++) tmpl[i]=' '; row=0; while(1) { fscanf(f,"%[^\n]",line); // dass ist es, das ich vergessen hatte i=fscanf(f,"%c",&i); // und hier if (i<1) break; memcpy(tmpl+row*80,line,80); row++; } fclose(f);