I am obviously missing some key pieces in terms of understanding how the flow because I'm still lost. The pen and paper idea is good. I have tried that with simpler program and been able to follow...
Type: Posts; User: kiddo
I am obviously missing some key pieces in terms of understanding how the flow because I'm still lost. The pen and paper idea is good. I have tried that with simpler program and been able to follow...
ok thanks,
but when is the code shown below called upon in the sequence?
int MultiplyIt( int myVar ) {
[return( myVar * gNumber );] what value is here and why?
and does the first pass...
As I am trying to learn C from an ebook as a precursor to developing with Objective C I can see that I must have gone over some of the initial basics a little too quickly to not be getting this.
...
The confusion starts with this line:
gNumber *= MultiplyIt( gNumber );
in plain english, what does it mean step by step?
Can anyone explain who the answer of 512 was reached for this code?
int gNumber;
int MultiplyIt( int myVar );
int main (int argc, const char * argv[]) {
int i;
...
Thanks. I've been working away at this for hours so I am going to revisit it tomorrow, check out the pointers tutorial and I will send you a reply if I have any questions.
Thanks again.
Ok. So thanks for explaining that that last part. I reconstructed the code from the example that you were trying to use to help me understand how the program and this is what I put together:
void...
so [ (*myVar) ++; ] is the same as saying 5 + 1 (or 6) which is then sent back up to be added to 19 to get and answer of 25?
I'm working my way slowly through a book called 'Learn C on the Mac' and I am doing the exercises at the end of the chapter. They ask you to predict the result based on being able to follow the code...
Wow, I finally understand! Thank-you. I totally respect and appreciate the way you laid this out for me and your effort to allow me to truly learn how to do it for myself.
I know that using my...
I'm closer to getting it. What would you do? Perhaps if I see the actual code that you would use then it might make more sense.
KIddo
Thanks guys! I read all your posts and tried several approaches. The one that I managed to get to work first was changing i to -1. I'm confused though that this:
i = -1;
while ( i++ < 3 )...
Hi I'm entirely new to C and I'm at the beginning of a very steep learning curve. It's important for me to completely understand each concept before moving onto the next step so that I don't get into...