Forum: C Aug 29th, 2007 |
| Replies: 17 Views: 2,271 system is in stdlib.h, not stdio.h. It's not a good idea either because now you depend on an outside program that might be malicious. It's a big security no-no because you created a hole that hackers... |
Forum: C Aug 21st, 2007 |
| Replies: 11 Views: 1,783 No, it doesn't. But you _do_ lose the only reference to the space you had, and that's called a memory leak because now it's allocated and won't be freed until the program ends. If your OS doesn't... |
Forum: C Aug 2nd, 2007 |
| Replies: 8 Views: 18,153 You need to include stdlib.h. The error cryptically tells you that malloc wasn't declared and the compiler just assumes it's a function that returns int and casting from int to char* isn't friendly. |