Declaring and Initializing String Variables

preview_player
Показать описание
C Programming: Declaring and Initializing the String Variables in C Programming.
Topic discussed:
1) Declaring a String Variable.
2) Initializing a String Variable.
3) Short length initializer.
4) Long length initializer.
5) Equal length initializer.
6) Omitting the length of the character array.

Music:
Axol x Alex Skrindo - You [NCS Release]

#CProgrammingByNeso #CProgramming #Strings #DeclaringStrings #InitializingStrings #StringsInC
Рекомендации по теме
Комментарии
Автор

Very helpful for all engineering students. Especially EC. Very clearly explained

sajinrajs
Автор

Have looked at many resources, books, articles, and videos. This was the first to point out the buffer was padded with null terminating characters. I suspected this was the approach a compiler would take, but didn't ever take the time to confirm this behavior. Thanks for sharing!

pattyspanker
Автор

Excellent presentation ! Thank you sir

rtype
Автор

that output is produced because the pointer dont find the null character so it continues to move forward until it finds one in the memory allocated to the program. in your case there were two strings stored to the pointer couldn't find a null character and it kept moving forward so everything in your memory is printed.

kalppariya
Автор

07:30 it is not "t[6]", it is "t[5]" actually.

onurolce
Автор

Thanks so much! I appreaciate your patient, organized, and well-explained lessons.

MrCEO-jwvm
Автор

Hey sir
I tested the same string literal example in turbo c and it worked .

zieyadahmed
Автор

Thanks very much for your clear presentation. My question is; How can I declare, initialize and assign the following characters Smarty and Stupity as the first names of my students, for instance if I was a programmer?

ndereratjijahura
Автор

The way u teach is just awesome ❤️❤️❤️❤️❤️

SumitKumar-xxpi
Автор

I love ur teaching u r my teacher, guru, god, I’m studying 10th std and interested in learning coding and learning a lot of things from you, thanks guru 🤓😘

AsteriskYoutube
Автор

He’s saving me for my digital systems exam

matteocorradetti
Автор

You could copied the string using for(i=0; sizeof(s); i++) that should copy in both examples and in the second example copy the \0 character

AZEMBadlen
Автор

Sir DBMS ka course start kariye na net exam ke liye aapke video bahut helpful hote hai

kapilatiwari
Автор

1:52
You're wrong on one thing... If the size of the string is 5 chars then we will declare it as char s[5] as here the number inside represents the index of the last character which is the null character and the string starts from the 0 index.

creedbratton
Автор

Nice video thanks for helping students

muskaan
Автор

int main()
{
char s[4] = "Neso";
printf("%s", s);
return 0;
}


This gives output Neso without any problem.

sairajdas
Автор

Hi sir, i just wanted to know about the lectures for "Data Structures" uploading time meanwhile awsm lectures of c .

yashpratap
Автор

Please activate subtitles for all lectures

mytube
Автор

But the array begin with arr[0],
So does the compiler ignore this bit?

short-cuts
Автор

hello sir, small doubt you added t[i]= '\0' at the end of the string in example doesn't it add the /0 automatically itself??

abhiramravuri
welcome to shbcf.ru