add malloc-new

master
neingeist 10 years ago
parent 7579fe1f6e
commit 4b953bf080

1
.gitignore vendored

@ -23,3 +23,4 @@ return-type-deduction
division division
poly poly
ohai-const-strings ohai-const-strings
malloc-new

@ -20,6 +20,7 @@ add_executable(bad_alloc bad_alloc.cpp)
add_executable(rtti rtti.cpp) add_executable(rtti rtti.cpp)
add_executable(poly poly.cpp) add_executable(poly poly.cpp)
add_executable(division division.cpp) add_executable(division division.cpp)
add_executable(malloc-new malloc-new.cpp)
add_executable(ohai-const-strings ohai-const-strings.cpp) add_executable(ohai-const-strings ohai-const-strings.cpp)
add_executable(future future.cpp) add_executable(future future.cpp)

@ -0,0 +1,15 @@
#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);
}
Loading…
Cancel
Save