Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

error 'new' undeclared (first use in this function)

hello,

is it possible to write like that in nios2 ide compiler:

tmp=new double [datasize1*datasize2]

because i have encountered this problem: error: 'new' undeclared (first use in this function)

or shall i use malloc?

thanks an advance.

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    'new' is a C++ operator, you probably only have (and want) the C library.

    So use malloc() or calloc().