Hi guys, I recently have an assignment which will read a file from command line. e.g. myprogram < input 1.) Would like to clarify that the way to read the inputs of the file would be to use fgets()? I have also tried using fscanf, and am not sure on which to go with. I have also searched through this forum and found sscanf, again, not sure on which one to use. 2.) A second problem I have encountered is that I have no idea on how to "break" the input up into how I want them to be. The contents of the input file is a mixture of alphabets and numbers. My understanding of fgets() is that it would read the whole line as a string right? So, for example the line read is " c918 = a1203 ". Could you point me in the right direction as to how I would convert that string "c918 = a1203" to an integer -> 918, and hex -> a1203. Thanks guys, appreciate the help
Use command line argument then.... using command line argument just pass the file u want to read and inside ur program output the file content in the console using file operations....