C_99 Returning Pointer from Function in C | C Language Tutorials

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

Use my code jkl10 to get 10% discount

Connect & Contact Me:

See Complete Playlists:

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

How to return anything from a C/C++ function like a string, or, array, int, or pointer. Please read on.
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
Автор

Quite tricky but you did justice to it.
Thanks from Nigeria 🇳🇬

petereziagor
Автор

Superbly cleared concept!!! U just nailed it!!!! In love with ur

shikhapatro
Автор

This was a very important concept, thank you for covering this!

nishyu
Автор

thank you so muv\ch dear mam usefull for all those unable to bless you mam ....

gabbarjadhav
Автор

@10:42 since a is an array, a=a+2 statement gives error

jaijaijaijai
Автор

Mam now we are a family of a half a million can you imagine all of us standing in front of you in a big ground or auditorium how would it feel like ???

rudrapatel
Автор

Very very thank you madam your video very very usefulness 🤗🤗🤗🤗🤗😊😊😊😊😇😇 I studied B.E cyber security and gate exam your videos for very useful Jenny madam

palanikanuu
Автор

Ma'am, you are more consistent than Thugesh!😅

kausikkar
Автор

If a is stored in stack memory of the returnPointer function then how it's not getting deleted when control is reaching out of this function

SN-editsu
Автор

But will returning a pointer be of any use since memory allocation to local variables of function will get deallocated after function exits, thus pointing to that location will be useless

NewGamer-dojk
Автор

Hi mam, I have not clrafied y we cannot do a=a+2, as per my understanding if we want to access the third element in array a we can do a[2], and other way may be a=a+2;
if possible could you please give an example to get this

vanik
Автор

Waah ma'am aap bhut khoobsurat ho...

anuj_chaudhary_
Автор

Maam please start structures
And unions 😀

ankithkumar
Автор

Mam, in declaration why we should write int* returnpointer instead of int returnpointer what is the difference in output?

MuddadaSameera
Автор

Maam then why you are not writing it as pointer in the function defination part ( int * p) you are writing it as (int a [ ]) why so.. please explain..?I have the screenshot to help you understand better my doubt but I cant upload it here due to non-availability of options

chiradeepbhattacharya
Автор

Do series similarly for java programming Mam

gowthamselvaraj
Автор

Mam How can i join iam10th but i love this leaning

pookkuttifamilyvlog
Автор

So in the series of c programming 🤣🤣🤣🤣🤣same line mam gjb

hitechaaso..
Автор

please upload c programming notes those written by you mam

gabbarjadhav
welcome to shbcf.ru