c and c++ programming difference-VI

@angnima (772)
Nepal
March 4, 2007 12:30am CST
c and c++ programming difference-VI: Implicit Assignment from void*: You cannot implicitly assign from a void* to any other type. For instance, the following is perfectly valid in C (in fact, it's arguably the preferable way of doing it in C) int *x = malloc(sizeof(int) * 10); but it won't compile in C++.
2 responses
@dholey (1383)
• India
1 May 07
instead of this we can say IN C++ WE HAVE ANOTHER BETTER METHOD FOR DYNAMIC MEMORY ALLOCATION.... in c++ a keword new is give which is not there in c.... instead of making variable (or araay) at run time we can use the following statement ;;;;;; int *p; p= new int[10]; any way nice to meet you ....
@Taskr36 (13963)
• United States
10 Mar 07
Dude, all this is bordering on spam. Cut it out or I will report you. If you really want to babble about c and c++, please keep it in one thread.