C_98 Return a String from a Function in C | C Language Tutorials

preview_player
Показать описание

Use my code jkl10 to get 10% discount

Connect & Contact Me:

See Complete Playlists:

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

Hello ma'am,
I'm currently in Final year B. Tech CSE.
I have been a silent follower since 3 years.
But now I'm writing this comment to tell you that I got placed in a company with 8LPA.
The DBMS playlist is the reason I could answer so many questions in exams and interviews.
I'm forever great full to you ma'am.
Thank you for doing what you are doing. ❤
Tonnes of Love ❤

chandanagv
Автор

I am 🇱🇰, i like your teaching style mam

shashinikarunarathna
Автор

Great! I cannot expect that the word "static" can change all my code^^ keep it fresh, thank you

kinegiap-kgpy
Автор

THIS WAS THE MOST *PACKED* LECTURE I EVER WATCHED UNTIL NOW IN C.

Maddie
Автор

Didi you are best teacher ever seen.Thank you so much.Take love from Bangladesh.

_debashisdhali
Автор

@14:49 it's not the heap area but the read only memory region where "Jenny" is stored. str is pointer in stack memory pointing to that address of that string and that address is returned. Heap memory is for dynamic allocation.

jaijaijaijai
Автор

How to return multiple values from a C/C++ function? It can be any value like int, float, double, string, array, structure., etc. Read one.
Usually, a function can only return a single value, using the return mechanism. If you try to return more than one value from a function, only one value will be returned that appears at the rightmost place of the return statement. However, you can return multiple values from the function using the pointer, array, or structure.
Using Pointers
You can use pointers to return more than one value from a function by passing pointers as function parameters and use them to set multiple values which will then have visibility in the caller function.
Using Array
If you want to return multiple values of the same data type from a single function, then using an array is best suited because when an array name is passed as an argument then its base address is passed to the function so whatever changes made to the array is changed in the original array.
Using Structure
Another way to return multiple values from a function is by using structures. Structure is a user-defined datatype in C that can hold several datatypes of the same or different types. The idea is to create a structure variable containing all required data types as its members and return that from the function. We can then retrieve the values from the structure variable inside our caller function.

SandipBhattacharya
Автор

Mam why teachers like you don't exist in clear explanation.... ithna command on language...I always wonder about your teaching mam .. it's serious...I swear mam....

chaitanyakumar
Автор

My question is about your explanation of the example beginning around 12:00 (video C_98). I am wondering why the string "Jenny" would be in the stack. I would rather believe that only the pointer str is in the stack. When the function returns str, it is the pointer that is not accessible anymore and, consequently, the string. I know the effect is the same, but my question is: "Are strings always stocked in an area other than the stack or can they be stocked in the stack also?". Thanks for your time.

jeanrioux
Автор

Mam explain me the difference among Static fun, Const fun and volatile fun and also Static variable, const variable and volatile variable . What will happen with them, when do we go for them in programming

venkatapathia
Автор

Mam you're teaching is really understandable. Can you please start JAVA class. I searched and find a cls but I can't understand that so can u pls consider this please mam start java cls soon.

JSR
Автор

char *str = "jenny"; jenny is stored in initialized read-only memory which is the part of data segment not in heap memory (your's comment)

rajeshnayak
Автор

this is my first videos from this playlist i understand 50% only....

narendernari
Автор

Because of your beauty i learned entire c + 😂😂

vijayyadav
Автор

Mam I am using turboo c and c language in mine program it change value jeeny to zeeny timeline 16:35

Itz_Armaan
Автор

This section cleared up a lot of confusion. Thanks, ma'am

misturaojulari
Автор

Omg this is the first vdo of this playlist where I really didn't get it 😐😶

kulkarnisoham
Автор

Maam, why didnt you write *str instead of str in main function while you are printing the str? As because we know *str means indirection, by doing we can access the value.. I am little confusion here..!! If u help me, it will be very helpful to me!

priyankapaul
Автор

Maam could you please start a course on core java

ankita
Автор

char *str="jenny"; gonna be stored in ROM not heap memory the heap memory is allacated only for dynamic memory allocation when using function malloc or calloc thank you

walidoulondon
join shbcf.ru