Discussion:
a3q2 using new/malloc in main
(too old to reply)
Rachel
2011-06-11 19:33:21 UTC
Permalink
According to the assignment specifications, we are not allowed to use
new/malloc in the routine processOneFile. However, are we still
allowed to use new/malloc in the main function? For example, can I
use the code from reversewords.cc, which dynamically allocates space
for the input and output streams to handle my I/O in question 2? Or
do I have to keep all my input and output on the stack? Thanks
Ashif Harji
2011-06-11 19:46:48 UTC
Permalink
You are allowed to use dynamic allocation in the main function.

ashif

The restriction only applies to the routine processOneFile.
Post by Rachel
According to the assignment specifications, we are not allowed to use
new/malloc in the routine processOneFile. However, are we still
allowed to use new/malloc in the main function? For example, can I
use the code from reversewords.cc, which dynamically allocates space
for the input and output streams to handle my I/O in question 2? Or
do I have to keep all my input and output on the stack? Thanks
Loading...