.. (לתיקייה המכילה) | ||
Q: What should we print when the program ends? | |
A: You can see the right output in the output files. You can also view the right output (along with an example to a function) in the image "Columns.bmp". |
Q: Can we use malloc from stdlib.h? | |
A: Yes you may, but notice that you can solve the exercise without using malloc (and it will probably be easier). |
Q: Is the length of the "main" function limited to 16 lines? | |
A: Of course yes. "main" is a function as any other function. |
Q: When I check some test with diffmerge I get that the output is the same, but when I check it using the selt test website I get "Fail". Why is that? | |
A: There are two main reasons why this could happen: 1. You are using an uninitialized variable. 2. You are accessing illegal memory, most likely accsesing an array/matrix beyond its scope. Since both of the above have "undefined behaviour", it is very likely that your code will work on your computer but fail on another computer. To test #1- initialize all your variables when you define them. To test #2- add an "if" statement checking that the index is valid *immediately* before *any* access to an array or matrix. |