Advertisement
CODE_TOLD_FAST

ISO_C/03/S.c

Jan 19th, 2020
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.97 KB | None | 0 0
  1.  
  2. //:         VIDEO: https://www.youtube.com/watch?v=TnrRkzC1_RU
  3. //:       CHANNEL: CODE_TOLD_FAST
  4. //: PASTEBIN_NAME: ISO_C/03/S.c
  5. //:  PASTEBIN_URL: ( See Youtube Video Description For Link )
  6.  
  7.  
  8. //# IDENTICAL CODE TO [SUB.C11 / SUB.EXE] in tutorial #2     #//
  9.  
  10. #include <stdio.h> //:for: printf(...)
  11. //! -------------------------------------------------------- !//
  12. //! Create and populate file with arguments passed to func   !//
  13. //! to simulate the main program running a sub program that  !//
  14. //! creates some type of meaningful data that the main       !//
  15. //! program can further use. ------------------------------- !//
  16. int main( int argc, char** argv ){
  17.     printf("[S.c:BEG:main]\n");
  18.    
  19.     FILE* file = fopen( "txt.txt", "w" );
  20.     int data = 666;
  21.     fprintf( file, "[HARD_CODED_DATA]:%d\n", data );
  22.     for( int i = 0; i < argc; i++ ){
  23.  
  24.         fprintf( file, "[ARG]:%s\n", argv[ i ] );
  25.        
  26.     };;
  27.     fclose( file );
  28.    
  29.     printf("[S.c:END:main]\n");
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement