cpp-exercises/malloc-new.cpp
2014-08-24 14:59:54 +02:00

15 lines
259 B
C++

#include <cassert>
#include <iostream>
using std::cout;
using std::endl;
int main(void) {
char** foo = new char*[100];
delete[] foo;
char** bar = (char**) malloc(100*sizeof(char*));
assert(bar != NULL);
// for valgrind to find:
// free(bar);
}