Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Macros

 
Ramesh Pramuditha Rathnayake
Ranch Hand
Posts: 178
2
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This prints:
36, 4
25, 5

Why i is still 4 in first case..?
 
Campbell Ritchie
Sheriff
Posts: 48445
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But my slightly different version produces 36, 6 and 25, 5. I suspect it is not strictly defined; I would suggest you will have to emulate the OP in this thread and go through the language specifications.

By the way: I thought you should always have () round the expressions in macros.
 
Ramesh Pramuditha Rathnayake
Ranch Hand
Posts: 178
2
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.. I know the importance to have () in macros. I didn't need to use it here..

I know that I've made the same mistake that I have done in my previous thread.. I know C is a real maze.

I understand that compiler is the reason for all of these stuff..!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic