Saturday, 27 October 2012

Program Of Write Arguments From Memory In C


#include  <stdio.h>
#include <conio.h>
 
 int  argc;                   
 
   char *argv[];               
 
   {
   
    FILE   *fp;
      
 int  i;
     
  char word[15];

       
fp = fopen(argv[1], "w");
    
   printf("\nNo. of arguments in Command line = %d\n\n",argc);
    
   for(i = 2; i < argc; i++)
    
    fclose(fp);

    Writing Content Of The File To Screen 


       printf("Contents of %s file\n\n", argv[1]);
     
  fp = fopen(argv[1], "r");
       
for(i = 2; i < argc; i++)
 
       {
   
 printf("%s ", word);
       }

      
 fclose(fp);
      
 printf("\n\n");

     Writing the Arguments From Memory

       for(i = 0; i < argc; i++)
     
  getch();
   }

No comments:

Post a Comment