if i have the following code:
for (…)
{
A a;
}
would a be allocated on the heap or on the stack?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
On the stack.
Memory is only allocated on the heap when doing
new(ormallocand its friends if you are doing things C-style, which you shouldn’t in C++).