Re: error-checking malloc, you can do this:
void *ec_malloc (size_t bytes) {
void *assign;
assign = malloc(bytes);
if (assign == NULL) {
puts("OUT OF MEMORY!??!");
...
Type: Posts; User: MK27
Re: error-checking malloc, you can do this:
void *ec_malloc (size_t bytes) {
void *assign;
assign = malloc(bytes);
if (assign == NULL) {
puts("OUT OF MEMORY!??!");
...
Yay cas!
I had not noticed this, but it certainly would constitute a "grave mistake" in the sense that it will work (since an int is at least the size of a pointer) but if these had been chars,...
Well, I don't want to mislead you -- my degree is not in computing. But if I walked into a prof's office during his/her consultation hours with a question or whatever and received that kind of...
I have a university degree and your prof is 1) a jerk 2) a jerk, and 3) a jerk, and I would bet money if you ask other students or even other professors they will confirm that. Don't take a class...