Compiler : Code:Blocks
Compiled Without problem
Code:
0 1 4 9 16 Process returned 0 (0x0) execution time : 1.110 s Press any key to continue.
|
Invasive contributor
|
![]() |
| 3Oct2011,07:12 | #11 |
|
OS : Windows 7
Compiler : Code:Blocks Compiled Without problem Code:
0 1 4 9 16 Process returned 0 (0x0) execution time : 1.110 s Press any key to continue. |
|
Ambitious contributor
|
![]() |
| 3Oct2011,07:14 | #12 |
|
Can you give it a try on Unix/Linux ??
|
|
Invasive contributor
|
![]() |
| 3Oct2011,07:16 | #13 |
|
Ambitious contributor
|
![]() |
| 3Oct2011,07:19 | #14 |
|
I dunno why its not giving any error on windows but logically when we are about to call free(), we have incremented the address held at pointer 'p' (as we have used p++ many times in loop). Now when we do a free, then 'p' contains a different address than what malloc() gave it. So ideally the program should crash at free().
|
|
Invasive contributor
|
![]() |
| 3Oct2011,18:23 | #15 |
|
Quote:
Originally Posted by poornaMoksha
|
|
Invasive contributor
|
![]() |
| 3Oct2011,18:30 | #16 |
|
Ambitious contributor
|
![]() |
| 3Oct2011,18:40 | #17 |
|
For problem '3', google how or rather in which order the function arguments are processed/passed when a function call is made.
|
|
Pro contributor
|
|
| 12Oct2011,17:53 | #18 |
|
This is good stuff. Are you going to provide the answer to all the questions eventually?
|
|
Ambitious contributor
|
![]() |
| 12Oct2011,17:58 | #19 |
|
Thanks, I thought of having interactive sessions with different users on this article. If somebody comes up with some doubt/query then I'll definitely answer that but providing answers directly would defeat the purpose as of now. All I want is that anyone who finds these questions worth trying, should try them. Answers, doubts, queries can be discussed here.
|
|
Banned
|
|
| 21Nov2011,15:51 | #20 |
|
It's a very interesting article.I like C program very much.So it's very helpfull to me.I can understand more programs&it's answer.
|