How to call “unlimit” in linux with c++

when i type "limit" in my machine:

the output will be:

cputime      unlimited
filesize     unlimited
datasize     unlimited
stacksize    8192k
coredumpsize unlimited
memoryuse    unlimited
vmemoryuse   unlimited
descriptors  32768
memorylocked 32 kbytes
maxproc      385318

But i want to make the stacksize to unlimited so i type "unlimit" in my linux konsole to make it unlimited.

However I want it to be changed automatically in my c++ program.How can I do it?
From the man page, "Warning: This routine is obsolete."
http://man7.org/linux/man-pages/man3/ulimit.3.html
Topic archived. No new replies allowed.