I want to make a file using fopen with a user given name eg. -o yeah
the filename will be yeah. I'm not sure how to do it since if I put fopen("%s",argv[2],"w") it will have too many arguements. Any thoughts?![]()
I want to make a file using fopen with a user given name eg. -o yeah
the filename will be yeah. I'm not sure how to do it since if I put fopen("%s",argv[2],"w") it will have too many arguements. Any thoughts?![]()
You have to find which argument is the "-o" argument. Let's say it's argument i; that means that 0 < i < argc-1, and you should fopen(argv[i + 1], "w");
))