why my code can't read the file

Linh nguyen 41 Reputation points
2022-10-30T16:11:53.53+00:00

help me plsss

255379-image.png

255453-image.png

255454-image.png

![255349-image.png]4

Developer technologies C++
{count} votes

Accepted answer
  1. WayneAKing 4,931 Reputation points
    2022-10-30T23:15:52.443+00:00

    I second Barry's suggestions.

    (1) Tell us exactly what is happening with your program.
    Error messages? Wrong output? No output?

    Is the file opening OK but failing during the reading?

    Or does the open fail? Note that since you have not
    specified a full absolute path for the file, then it
    must be in the correct folder (usually the current path)
    for it to be found by the IDE during debugging.

    For VS this is usually the same folder as where the .cpp
    and .vcproj files are located.

    Also note this from the docs for fscanf_s:

    "fscanf_s doesn't currently support input from a UNICODE stream."

    (2) Post the actual code from your program, using
    Windows copy & paste, and put it in a "Code Block"
    in the forum message editor.

    One small observation - your code has:

    cout << a.list[i][j] << "/t";  
      
    

    I suspect you wanted a tab character which is "\t"
    or '\t'.

    • Wayne

1 additional answer

Sort by: Most helpful
  1. WayneAKing 4,931 Reputation points
    2022-10-31T08:41:32.05+00:00

    This line is wrong:

    for (int j = 0; i < a.m; j++)  
    

    It should be:

    for (int j = 0; j < a.m; j++)  
    
    • Wayne

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.