Тёмный

Advanced Programming in the UNIX Environment: Week 05, Segment 12 - Using gdb to understand pointers 

cs631apue
Подписаться 5 тыс.
Просмотров 1,4 тыс.
50% 1

Опубликовано:

 

1 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 8   
@gautamkumarshukla3055
@gautamkumarshukla3055 2 месяца назад
sizeof(buf1) or sizeof (buf2) , will give the size of the pointer isn't it and not the actual size ?
@cs631apue
@cs631apue Месяц назад
Yes - good catch! Somebody else had noted this, too (see comments below), and since this is an easy and common mistake to make, I had created a separate video explaining the issue: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-FyPqII2rewA.html Unfortunately I don't have a way to edit or annotate the video. I may need to redo the whole video and upload a new version at some point.
@FabioTavano
@FabioTavano 8 месяцев назад
Hi professor, I think it would be more useful, from the point of view of someone not that accustomed to Vim, to let the overlay that displays the characters pressed...maybe in a corner and not too big, just for reference in case someone wants to rewind and see, for example, how to copy and paste in Vim. I know, maybe I'm too spoiled but I just thought that it may be nice. Thanks again (also) for this course, it's really appreciated!
@cs631apue
@cs631apue 8 месяцев назад
Hey Fabio - that's a good idea! I'll definitely keep it in mind for the next videos.
@holySICPer
@holySICPer 3 года назад
Thanks I did the wrong way for so much time, the overflowing one, but now I understood how to easily avoid it
@otziotzi2157
@otziotzi2157 3 года назад
I really like Your videos. I think I watched all of them to refresh my knowledge and also to learn something new. Regarding this video I have one comment. You are using here sizeof providing as a parameter pointer, and as probably you are using 64 bits OS, the result you get is correct i.e. it returns 8 which is the same value as a parameter provided when the program is run. Providing value other than 8, as a parameter, will cause the program behaving wrong. I am not sure if this is intentional, but someone may think that using sizeof for a pointer returns number of dynamically allocated bytes of memory to which this pointer refers to, but this is wrong assumption, as it returns size of the pointer itself which is 4 bytes on 32bits system and 8 bytes on 64 bits system.
@cs631apue
@cs631apue 3 года назад
Thanks so much for your comment! You're of course correct, and I should have caught that. I'll see if I can fix that portion of the video in the future to clarify. For now, I hope your comment here helps others.
@cs631apue
@cs631apue 3 года назад
Rather than delete this video and try to replace it with an updated version, I put together a whole separate video on the use of "sizeof": ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-FyPqII2rewA.html
Далее
Как открыть багажник?
00:36
Просмотров 14 тыс.
ОБЗОР НА ШТАНЫ от БЕЗДNA
00:59
Просмотров 391 тыс.
Как открыть багажник?
00:36
Просмотров 14 тыс.