[Dev-C++] Correct use of pointers II
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <and...@su...> - 2003-03-15 22:44:59
|
Gentlemen,
1. In a generic point of view, can I use this code? (Y/N)
2. Would it be technically correct? (Y/N)
#include <stdlib.h>
int main()
{
int a=3, b=2, *p;
p=(int *)malloc(1*sizeof(int));
*p = a + b;
/* .... */
free(p);
}
Thanks
|