| | |
output in c programming
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Your question seems clumsily constructed and you haven't used code tags. Be specific when asking questions.
Last edited by devnar; Nov 3rd, 2008 at 4:49 pm.
This is homework assignment and gayatri apparently wants us to do it for him/her.
The code you posted will have undefined behavior.
The code you posted will have undefined behavior.
cube(++x) could result in different answers on different compilers, so the ourput can not be determined exactly. Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
•
•
•
•
The code you posted will have undefined behavior. cube(++x) could result in different answers on different compilers, so the ourput can not be determined exactly. cube with the new value, then returns the answer to y. What's undefined about it? i isn't modified twice. The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
•
•
•
•
Why? It increments i, calls cube with the new value, then returns the answer to y. What's undefined about it? i isn't modified twice. c Syntax (Toggle Plain Text)
# define cube(x)(x*x*x) int x = 2; y= cube(++x); is y = (++x*++x*++x);
![]() |
Similar Threads
- project of c programming (C)
- own programming language? (Computer Science)
- How to code a program that can show color text output??? (C)
- Google Programming Searchengine (Computer Science)
- wrong output in c program (C++)
- java programming (Java)
- Output in the text file (C)
- Tips on windows programming (C++)
- Efficient Programming (Computer Science)
- help about programming (C++)
Other Threads in the C Forum
- Previous Thread: Counting program executions
- Next Thread: Help with http port cheker which uses sockets
| Thread Tools | Search this Thread |
Tag cloud for C
#include * append array arrays asterisks binarysearch calculate changingto char character cm command copyimagefile cprogramme creafecopyofanytypeoffileinc database directory dynamic execv feet fgets file fork forloop framework function functions givemetehcodez grade graphics gtkwinlinux hacking histogram homework include incrementoperators input intmain() iso kernel keyboard km lazy license linked linkedlist linux list lists locate logical_drives looping loopinsideloop. lowest matrix microsoft motherboard mqqueue number oddnumber odf opensource overwrite owf pdf performance pointer posix problem probleminc process program programming radix recursion recv recvblocked research reversing scanf scripting segmentationfault sequential socket socketprograming spoonfeeding standard string student systemcall testing threads turboc unix user variable wab whythiscodecausesegmentationfault windowsapi






