Constant Pointer VS. Pointer To A Constant | C Programming Tutorial

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

These tutorials are the best ever; practical and to the point where you can clearly see what's going on an how it all actually works with good explanation and without the clutter that most other tutorials drag out for hours. Thank you :)

Mtlik
Автор

Im a little late here but your videos about pointers have helped a ton. Previously they were like eldritch magic to me, I was casting the pointer spells but the forces behind them were beyond my comprehension, but now I have a much more solid understanding of them. Thanks!

astra
Автор

I really hope u gonna keep doing these great turorials. Thank u very much!

samirprostov
Автор

Great video. Very clear. The old read right to left rule.

jonathanmoore
Автор

Very nice video. I think the problem with C pointers is the syntax of C and the re-use of the same symbol to mean 2 different things. And that one needs to read pointers right to left. Doing that makes it a little more understandable

qcnck
Автор

Good video - this concept has important ramifications in an embedded environment. Microchip cover this in their tutorials.

relativenormality
Автор

my head hurts! Great videos but I am going to have to watch this about 10x. I have kept up with all the other videos just fine but this trying to wrap my head around this one is tough.

ChrisNoesen
Автор

These videos are very helpful and you explain concepts very well, however, do you think it would be possible to also draw out what you are explaining? Like how it behaves on the stack and in memory (I am still learning so I may have used these terms incorrectly) but I hope you understand what I mean. Personally, I am a better visual learner so if you were to draw out the memory it would help reinforce the subject to people like myself. Thank you for all your help so far tho!

tomassauce
Автор

4:49: This is probably too obvious for an experience programmer to even notice as a problem or question, but at this point it would have been helpful to point out that while the value of *pointer_to_const cannot be changed directly, in this example that ostensibly constant content could still be changed by simply changing char b, like so:
b = 'z';
A further line of
printf("*pointer_to_const: %c\n", *pointer_to_const);
would then print the changed const value just fine.

ropersonline
Автор

Why can you use pointer_to_const to point to a non const char? Is it that it will treat it as a const even though char a was defined originally as a just char? In summary, the const behavior is up to the pointer?

juliopchile
Автор

Nice Tutorial. I was missing one thing. I would assume, that the value of a pointer to a constant is only immutable, when accessed through this pointer. So you could still change the value when it's accessed through another pointer (without the const keyword) or directly through the variable. Is this correct?

Gsudi
Автор

I understood the first 15 seconds of this video perfectly!

retrotechnerd
Автор

Can you provide practical use of this in different situations in real life programming?

komalshah
Автор

It is only compiler instructions?
Or this memory is located in special area?

BetelgeuseX
Автор

The trick is to read the statement from right to left then all will make sense.

RebelliousX
Автор

If I declare like this
const char const *p;
What happen???

Raam
Автор

So a pointer to a constant, cant we just write const char b?

fuzzy-
Автор

You forget to mention what you can do with a constant pointer...

y_x
Автор

You said the same thing soooo many times.

johnjoyce
Автор

I hate this a little.
Why is is not like you say it in English and like you would declare the variable if it would be a pointer.

const char = constant char
char* = pointer to a char
const char* const pointer to a char
*Const char = pointer to a Const char

That would be way less confusing

hansdampf