Thursday, September 16, 2010

Using C functions like malloc in C++.


#include iostream

using namespace std;
extern "C"
{
int puts(const char *); // Using C style functions in Cpp.
void * malloc(std::size_t);
}
int main()
{
puts("helo world ! ");
int *p;
p=(int *)malloc(sizeof(int));
return 0;
}

No comments:

Post a Comment