C_07 Constants in C | Types of Constants | Programming in C

preview_player
Показать описание
Discussed all the type of Constants in C language

Enrollment links:
To get 10% discount use Invitation Code: JKL10
Unacademy is back with yet another exciting Test "GATE Challenge".
The challenge consists of 4 levels and consists of All the engineering Branches (Mech, Civil, Electrical, ECE, CS/IT, Chemical). The first 3, levels each are a set of 30 questions in 90 minutes to warm you up and get ready for the grand finale which will have 65 questions, to be solved, in 180 minutes. All the questions are designed and curated by the best faculties in Unacademy, just not this All India Ranking of the test would be provided if you give the test live.
Connect & Contact Me:

See Complete Playlists:

Рекомендации по теме
Комментарии
Автор

Lecture is awesome but the letters on the white board is not clear due to the light effect

raminenisravani
Автор

Adding more to the information presented above:

When a variable is declared as const, it's stored in read-only section of a memory (.rodata segment). That's the reason when you try to modify the value of that variable, you will get an error: assignment of read only variable. Also, where const is placed also changes the meaning of the declaration. For eg.
1) const int a -> It means a is a constant integer
2) int const a -> Same as 1. It means a is a constant integer
3) const int *a -> Here a is a pointer to a constant integer
4) int * const a -> Here a is a constant pointer to a non-constant integer. The value of pointed integer is modifiable, but the pointer is not modifiable.
5) int const * a const -> Here a is a constant pointer to a const integer that means the value of the pointed integer and pointer both are not modifiable.

const qualifier always applies to what is present to it's immediate left. If nothing is on the left, then it applies to whatever is on the right.
The whole point of a const qualifier is to make sure you don't accidentally change value of the variable which is supposed to be constant. Though, value of constant integer can be changed through the use of pointers.

For eg.
const int a = 10; // Here a is a const integer which will not be modifiable
int *myPtr = &a; // Pointing to the constant variable
*myPtr = 20; // Changing the value of constant variable
Now if you print a, you will see value to be 20. The reason why this happens is because the pointer that is pointing to the const variable is a non-constant pointer. If you want to make sure not even a pointer should be able to change the value of a const variable then you should make the pointer a const too.
eg. int *const myPtr = &a;

This way your const stays safe.

indianguy
Автор

These are still helpful in 2024 mam thank you soo much❤

Rashmi
Автор

if you are following lecture try to run following code in online compiler or in vs code

#include <stdio.h>

int main()
{
printf("%d", 'a');
printf("\n");
printf("%c", 97);

return 0;
}

nitishofficial
Автор

NOTE :-
@10:50 '/0' Is not back slash zero . the correct one is '\0' .

yashmishra
Автор

I finally understood a concept that I was looking for since we start C in my college. Thanks a lot . You're the best.

_AHMATSENOUSSI
Автор

2 saal mauj kiye, ab 3rd year mein aake c padh rahe hain, but mam ne concepts badhiya clear kar diye abhi tak... Lots of love ❤❤❤

leaderrr_shivam
Автор

Mam I really appreciate your effort for uploading quality content video every day.

aartisharma
Автор

No words to explain your efforts and patience.Thank you so much mam.

gowthamgandu
Автор

May be iam the one who is watching in 2024 for diploma in cse😅

Deepikareddy
Автор

Thank you so much mam, you are really blessed with knowledge, kudos

waterford
Автор

Ma'am really I have no words to say THANK YOU to you
your way of explaning is just amazing
Thank you sooo

artwithakshita
Автор

Hii ma'am I have one doubt ma'am

abbaraboinavinay
Автор

When I was checked in compiler. It is correct.

Gannibhai
Автор

Integer is also part of real numbers in maths. U can say only float to non integer parts of a number.

computerbyravivaishnav
Автор

Thank you ma'am.❤️❤️ . Ma'am please upload videos of function, pointer of c.

tithighosh
Автор

One of the best teacher I have come up...Thanks alot

whysoserious
Автор

Getting error in the case of constant But getting error as redefinition for the below code in the case of not constant as well.
#include<stdio.h>
int main()
{
int a = 10;
int a = 20;
printf("%d", a);
return 0;
}
But Your teaching method and explanation are awesome!!!

manirulmolla
Автор

I love you I was taking the videos 10 per day. As a gym for my Alx SE program. Thank you Jenny.


Jayanthi Khatri Lamba to the world. I'm from Nigeria❤❤❤

bimglobal
Автор

Mam based on your rules how to separate multiple
intiger values assigned to a variable

ShanmukeshwaraShanmuka