Warning: include(topsc.html): failed to open stream: No such file or directory in /home/eng123/public_html/sourcecode/c/unix/print_stuff.html on line 14

Warning: include(topsc.html): failed to open stream: No such file or directory in /home/eng123/public_html/sourcecode/c/unix/print_stuff.html on line 14

Warning: include(): Failed opening 'topsc.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/eng123/public_html/sourcecode/c/unix/print_stuff.html on line 14

Home
Source Codes
Engineering Colleges

Training  Reports
Seminar Reports
Placement Papers

Forums

   Computer Science / IT
   Electronics
   Electrical
   Mechanical
   Chemical
   Civil

   CAT / MBA

   GMAT / Foreign MBA
Latest Jobs

Engineering Jobs / Technical Jobs
Management Jobs

Sitemap
Terms of use

Displaying  Source Code(s)  
 


Warning: include(adsc.html): failed to open stream: No such file or directory in /home/eng123/public_html/sourcecode/c/unix/print_stuff.html on line 32

Warning: include(adsc.html): failed to open stream: No such file or directory in /home/eng123/public_html/sourcecode/c/unix/print_stuff.html on line 32

Warning: include(): Failed opening 'adsc.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/eng123/public_html/sourcecode/c/unix/print_stuff.html on line 32

 
Write a program to print stuff to a file reading the number of time for an other file.

--------------------------------------------------------------------------------



/*
* Write a program to print stuff to a file reading the number of time for an other file
*/

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

void writefile(char *);

int main()
{
int N;
FILE *inf;
int i;

inf = fopen("infile.txt", "r");

/* Now let us read the number from a file */
fscanf(inf, "%d", &N);

for(i = 0; i < N; i++)
writefile("Unix Programming Lab.");

printf("<BR>);
fclose(inf);
return(0);
}

void writefile(char *str)
{
FILE *outf;
int i;

outf = fopen("outfile.txt", "a");

/* Now let us write to the file */
fprintf(outf, "
%s", str);

fclose(outf);
}

 

 

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved copyright 123ENG