Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //: VIDEO: https://www.youtube.com/watch?v=TnrRkzC1_RU
- //: CHANNEL: CODE_TOLD_FAST
- //: PASTEBIN_NAME: ISO_C/03/S.c
- //: PASTEBIN_URL: ( See Youtube Video Description For Link )
- //# IDENTICAL CODE TO [SUB.C11 / SUB.EXE] in tutorial #2 #//
- #include <stdio.h> //:for: printf(...)
- //! -------------------------------------------------------- !//
- //! Create and populate file with arguments passed to func !//
- //! to simulate the main program running a sub program that !//
- //! creates some type of meaningful data that the main !//
- //! program can further use. ------------------------------- !//
- int main( int argc, char** argv ){
- printf("[S.c:BEG:main]\n");
- FILE* file = fopen( "txt.txt", "w" );
- int data = 666;
- fprintf( file, "[HARD_CODED_DATA]:%d\n", data );
- for( int i = 0; i < argc; i++ ){
- fprintf( file, "[ARG]:%s\n", argv[ i ] );
- };;
- fclose( file );
- printf("[S.c:END:main]\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement