: read your code. Make sure that the snips do what they are supposed to.
Read the compiler messages
ex3.c:38:14: warning: ‘intArray2’ may be used uninitialized in this function [-Wuninitialized]
Once you fix that, run the program through a debugger http://www.cplusplus.com/articles/iwTbqMoL/
If you are lucky it will crash. Check out for undefined behaviour (like out of bounds access)
Compare the output for the test with the solution. Create more tests if needed.
Review your algorithm.
|it would be great if someone give me the final code|
No, it wouldn't.
Topic archived. No new replies allowed.