Programación General > C/C++
duda
Mendes:
int main()
{
int i = 1;
printf (“%d %d %d”, i++, ++i, i++);
}
Ante este programa la salida seria 1 2 1 ó 1 3 4?
Jeysscarr:
La salida seria 3 3 1
Mendes:
el problema es que tengo este condicionante, entonces no se si el valor de i se actualiza antes o despues:
Assuming that the evaluation of each parameter value passed to a function is always done right prior to the parameter value being pushed to the stack (not every compiler works this way) please indicate what the output of the following would be, draw how the stack would look like after printf(…) is entered and explain why it needs to be that way.
int main()
{
int i = 1;
printf (“%d %d %d”, i++, ++i, i++);
}
Jeysscarr:
http://es.answers.yahoo.com/question/in ... 219AAZEp9W
Mendes:
Gracias, por el enlace, pero entonces la salida no seria 1,3,3 en vez de 3,3,1?
Navegación
[#] Página Siguiente
Ir a la versión completa