|
Team Leader
|
![]() |
| 26Dec2006,18:41 | #11 |
|
Personal outlook: don't cast the return of malloc, in C (don't use malloc in C++). In any project that isn't trivial, the probability of correctness is greater if one relies on the compiler.
|
|
Go4Expert Founder
|
![]() |
| 26Dec2006,19:52 | #12 |
|
I just made one more try for the followin.
When you have the file as .c in MS compiler for the code Code:
int main(){
int *ptr=malloc(10);
return 0;
}
|
|
Contributor
|
|
| 26Dec2006,20:09 | #13 |
|
Try compiling in strict mode. You can even try online compiler .
|
|
Newbie Member
|
|
| 27Dec2006,07:46 | #14 |
|
it could be alot simpler a problem...
try: char *x = "C-PROGRAMMING"; char *Prog = (char *)malloc(strlen(14)); |
|
Go4Expert Founder
|
![]() |
| 27Dec2006,09:55 | #15 |
|
The online compiler gives error when not type casted.
|


