Click here to Skip to main content
15,667,014 members

Comments by Jose David Pujo (Top 11 by date)

Jose David Pujo 25-Feb-13 7:08am View    
Reason for my vote of 5 \n Works as charm! Great work. Compiled and tested perfectly.
Jose David Pujo 31-Jan-12 10:59am View    
Reason for my vote of 5
A nice tip for "What to care of..."
Jose David Pujo 31-Jan-12 10:57am View    
At first glance, I was sure that the result of "s" should be 12. So I had to test it. And the result was 16... ???
So I watched the the assembly:

int y = 2;
01848801 mov dword ptr [y],2
int s = SQUARE(++y);
01848808 mov eax,dword ptr [y]
0184880B add eax,1
0184880E mov dword ptr [y],eax
01848811 mov ecx,dword ptr [y]
01848814 add ecx,1
01848817 mov dword ptr [y],ecx
0184881A mov edx,dword ptr [y]
0184881D imul edx,dword ptr [y]
01848821 mov dword ptr [s],edx

Now it's clear why the result is 16.

Anyways, I use frequently Macros but never with ++ operator.
Jose David Pujo 30-Aug-11 2:13am View    
I am using the following includes in stdafx.cpp (Visual Studio 2010 project):
#include "tchar.h"
#include "iostream"
#include "windows.h"
Jose David Pujo 25-Aug-11 8:08am View