CCoding Style - Be careful with side effects3
Revision as of 09:30, 23 June 2015 by Jshankar (1 revision imported: EdWiki -- Emsys pages from Shukra)
Be careful with side effects ...
It is not just increment and decrement that have side effects; Input/Output is another source of behind-the-scenes action.
scanf(“%d %d”, &yr, &profit[yr]);
Break it into two statements:
scanf(“%d”, &yr); scanf(“%d”, &profit[yr]);