Hi Charles,
this code compiled okay , but crashed when run it.
includepath "$\inc\"
$filename "test1.exe"
#include "RTL32.inc"
#include "console.inc"
includepath ""
#include once "msvcrt.inc"
struct point
{
int x
int y
}
function GetMEM(long x) as void*
return malloc(x)
end function
int main()
{
point* pt;
pt = GetMEM(sizeof point)
printf( "%d\n" , pt.x )
waitkey
}
main
1- what wrong with this code ?
2- when compiling zilb there was "->" ,[c operator], and oxygen compiled it without error.
when replace pt.x in my example with pt->x oxygen give error, why?
thanks for help.
edited:
is there a c++ style operator "new" so
pt = GetMEM(sizeof point)
will be
pt = new point