I’m trying to following to application in OOP C but I get errors in my new.h file.
I am getting a bunch of “unexpected” errors.
Just about everything after the first ‘void’ is exepected.
Any ideas?
#ifndef NEW_H
#define NEW_H
#ifdef __cplusplus
extern "C" {
#endif
void * new (const void * type);
void delete (void * item);
#ifdef __cplusplus
}
#endif
#endif /* NEW_H */

If you want to simulate the functionality of
newinCas it inC++then you are actually given wrong argument ofnew.It should be
const unsigned intorconst size_tbecause new is used in C++ as
But here it’s type mismatch can’t convert
inttoconst void *For
deleteit’s fine becausedeletetakespointeras argument