I've got another question that hinges on right associativity.
I got to the next chapter, on pointers and arrays, and was having some difficulty understanding the statements in this chart. I...
Type: Posts; User: potomac
I've got another question that hinges on right associativity.
I got to the next chapter, on pointers and arrays, and was having some difficulty understanding the statements in this chart. I...
I think a lot of it comes down to right associativity. Up until this point in the book, we had only used left associative operators, not right ones like * and &. I flipped to the Appendix on...
Thanks hobbit. that's very helpful
happy new year to you too
I think I'm getting the hang of pointer basics with my textbook. I've read the chapter a couple times now and it's starting to make sense
A few lingering questions from the exercises I completed
...
That makes sense. Have to keep repeating to myself that a pointer is an address.
After reading my 2 book chapters twice, reading Alex's tutorial, and watching some videos, I'm at this phase...
This is the only question I got wrong on Alex's quiz for beginners. I'm unsure why it's correct. I drew out what I think the sentences represent.
I don't get why the unnamed variable pointed to by...
I don't intend to do anything with that knowledge. Just a curiosity.
I was particularly interested in just seeing if a single line of JavaScript can sometimes be equivalent to a ton of lines of C....
Could you say that the Python code "received" by interpreter will always match up with a line/several lines of C or C++ code?
What would be the best way to look at that open source Python code and...
Ah thanks that worked! Thanks
Whoops, I missed that scanf &.
Also corrected those style error
I still, however, get compiler errors for uninitialized variables f1 and i
14986
I'm continuing on with my textbook and going through the examples on pointers.
There's one example that compares two similar programs to illustrate the value of using pointers as arguments to...
I've heard this said before and it half makes intuitive sense. One example is this video at the 1 minute mark: Why C Programming Is Awesome - YouTube
I think it might have something to do with...
Thanks for the responses again guys. Very helpful. Salem's mail analogy was good. Hobbit, I get why pointers are useful now thanks to your elaboration (so you can avoid relying on copying a...
^ I think I should have written pointer variable in my title?
Is there a difference between a pointer variable and a pointer?
Does a pointer consist of a pointer variable + an address?
I've...
This was the text from my book that I'm basing my simplified mental map on:
(page 207)
The * operator relates to pointer variables. The act of declaring a pointer variable sets aside memory...
I was wondering if this is the right way to think about pointers (*operator), addresses (& operator) and variables. I'm giving a simplified explanation in the black boldface text, and a more...
That also is helpful in refining my understanding because I think I have been assuming the "top" to be pointing to the right-most slot to be filled with a value. Rather than 1 slot (unfilled) ahead...
Hobbit, the comment about the array not zeroing out is helpful. I didn't think to consider that the data stays there in memory until written over
So the result I'm seeing it entirely consistent...
Here's a PDF showing what I saw on my screen in my debugger. File was 2.5 mb and I couldn't upload it to the board: https://www.pdf-archive.com/2016/12/23/walkthrough/
It's showing that the stack...
I managed to trace the array and variable c in Visual Studio
It looks like this is the trace for: (){}
So it doesn't look like the array is totally clear at the end. Also, the array never has...
Thanks for the tip on "Watch"
I was able to add one for the array
14984
I get the idea of a basic stack (LIFO), but this program's execution has me flummoxed.
Is there a way I can modify my code so that I can see the values contained in the stack as I step through...
Breakpoint 39 solved it! I'll have to remember that the issue with my breakpoints is always an "off by one line" of sorts!
So is the array only ever filled with one character or two characters in...
I made it to the chapter in my book on program organization. It also introduced the concept of the stack data structure and gave this example program. Full code and question text is below
I have...
^ Funny that you mention C99. I'm using the 1st edition (1996) of the KN King book. There is a 2nd edition from 2008.
I have it only because it was about $100 cheaper than the 2nd edition on...