Difference between int main and void main in c programming | Dr. Yogendra Pal | Hindi / Urdu
Вставка
- Опубліковано 7 вер 2024
- Novice programmers always have this confusion about using integer return type or void return type with main function in a c program. In this video, Dr. Yogendra Pal will explain why int main () is correct and why void main is not correct. He will explain it in detail and after watching this short video you will never complain that you don't know the difference between int main and void main in a c program.
Join online course: goo.gl/zvyPpY
Programming group on fb: goo.gl/WsqzNN
Learn By Watch Programming Channel: / @learnbywatchprogramming
Superb without wastage of time.. direct point to point.. no promotion for channel. Really thank you sir
Most welcome
Thank you for deep explanation. I have watched soo many videos on "use of Return" on UA-cam. Everyone else is saying that value should be returned to OS.. that's it.. but watching this video I got to know actually what happens inside the OS.
thank, from Pak. you teach in a basic way... thumbs up
Thanks dear
that is not understanding easily they are talking about just hardware and os
Thanks for the explanation sir... But you didn't tell the function of void main
yes
Yes
No
Yes
Yes
Best explaination on return o that i have ever seen .
wow! difference between int main and void main me , ek baar bhi void main ka naam tak nahi liya video me, thanksssss for that.........
It is very simple bro,
Void main me hum koi bhi value return nahi kar sakte because uska return type void hai aur
Int main me hum value return kar sakte hai kyuki return type int hai.
Agar apko abhi bhi doubt hai to hamari channel par aakar comment jarur kare
Thank you .
Yeh samjh gya ki hum int main ka use value return karne ke liye karte hai but kya int main sirf :- int a, b; mtlb sirf integer data type ke liye hai ya fir hum isse string ke programs bhi use kar sakte hai ya fir string ya char ke liye void main ka use kare sir? 😢
void main() ka use karna nahi chahiye, kyunki void main kuch return nahi kar sakta. int main() ka use hi karna chahiye. int main function me sirf integer hi return kar sakte hain, char, string ya koi aur data type nahi.
explained in few words but perfect !
Love you sir !! U cleared my doubt !
Welcome
it is necessary to use int main() in c++ with return 0;
int : A program which is related to numbers.
Void : A program which is related to word extraction.
Wrong information, this is correct only for non main function.
Thanks for conceptually explaining!
Thank u so much for explaining in depth level
it is necessary to use int main() with return 0; in c++
Thank you so much Sir
Most welcome
But ok I learnt why we use int main
Best explanation
very well explained, sir
This is best example for return type
Thanku sir
My problem is solved sir
Thanks sir for information.
thank u sir but when we use char main() with return 0 in program than also our program run successfully why ,it is necessary to use int main() in c++ if it is so why program run using char main()
do you got your answer if yes then explaiin please
For anyone else with this question, the operating system only cares about getting a numeric value from main(). A 'char' variable is just a 1 byte integer. When you print a char using cout or printf, it displays the ASCII value of the variable instead of the raw integer.
So char main() isn't wrong, but we prefer using char only if we need the corresponding ASCII value
hello yogendra palSir, Please upload an video for strong self determination, will power, save your time.
All study tips videos are available on this page: www.learnbywatch.com/learn/study-tips/
Sir also tell where we can use conio.h and stdio.h
Thanks sir very clearly understand..👍
Glad to hear that
thank you sir
Most welcome
Nice 🙏thank you
Thanx or videos banio
Jaldi banayenge
Kya baat hai sir❤❤❤❤❤
nice explanation👍
Sir I have one doubt if we have made one application then that application already have consumed space so whether we run it or not it will consume space so what hardware resources it return
thank you🥺
Very
Too great
Excellent
Muze ye pehle hi pata tha😊
nhi samajh aaya
difference b/w void main
and int main😐😐!!
I am watching this video 2024 in 16 july 😇
where is void
Thanks a lot...
well it is necessary to use int main() with return 0; in c++ ?
Thanks
Sir
Ek program me maine void main use kiya to run karne k time error me likha tha ki "it must return an integer value"aur phir maine void ko remove karke int likh diya aur phir program run ho gya bina return 0 likhe
It was a C program
Plzz explain aisa q hua
Because when main terminates it will be automatically assigned return 0
This is not explanation, this is confusion!
What if I don't write return 0 at the end after using int main ()?
I don't write return 0 but my program still works properly 🤔🤔🤔
Yeah that's what I am not able to understand
It's not about your program working properly. If you don't write return 0 at the end of the program it will tell operating system that program is not yet complete and OS will not free the resources.
What about void function
To whom main function is returning value
Operating system
Nice sir
Isme voida ka use to bataya hi nhi 🫡
Sir toh fir void main() toh return 0 nhi deta toh iska matlab ye h ki program wrong h ya program khatam nhi hua hai ...😅
Nahi, program to khatm ho gaya par OS ko nahi pata chala.
Sir mujhe aap ki upload sari video chahiye
toh kisi se liya hoga😳😳
*silent for sometime*
chizz😆😆
that one was epic😂
Gol gol kyo ghuma rahe ho
Important points batao na
sir agar return 0 ki jagh yadi return 88 ya fir -1 likhe to kya program successfully execute hoga
Operating system will assume that your program terminated unccessfully. If OS understand the meaning of that code than act accordingly otherwise free all resources.
Bilkul samajh nahi aaya sab ghuma phira ke 1 hi baat karte hai.5 Saal se c language seekhne ki koshiah karraha hun aajtak koi bhi sahi se ye nahi bata paya ke ....
int main() ke saath return 0;
Q likhte hai?
int main() Vs void main() ???
0 ka matlab program successfully execute hua hai. Ye value Operating System ko milti hai aur vo is program se related sabhi resource memory etc free kar deta hai.
Agar 0 nahi mila to iska matlab hai program theek se execute nahi hua hai aur kuch gadbad hui hai.
Void main() likhna isliye galat hai kyunki void ka matlab hota hai 'khali" yani OS ko program end hone par kuch return nahi milta hai. Jisse OS ko pata hi nahi chalta ki program end ho gaya aur isse related resources ko free nahi kar pata.
👍
SAHI KAHA SIR AAPNE JO CHEEJ HUM NAE LIHI NAHI VO LOVTAL KAISE DE😭😭😭
Hope it's in English language
You didn't say when to use void main
Never use void main
Void kaha hai?
It is very simple bro,
Void main me hum koi bhi value return nahi kar sakte because uska return type void hai aur
Int main me hum value return kar sakte hai kyuki return type int hai.
Agar apko abhi bhi doubt hai to hamari channel par aakar comment jarur kare
Thank you .
sir apki c programming ki playlist ki link ?
well it is necessary to use int main() with return 0; in c++ ?
Aap nay return 0 samjha ya int main or void main nhi
It is very simple bro,
Void main me hum koi bhi value return nahi kar sakte because uska return type void hai aur
Int main me hum value return kar sakte hai kyuki return type int hai.
Agar apko abhi bhi doubt hai to hamari channel par aakar comment jarur kare
Thank you .
Bad
0:36 hahaha😁😅😅😅
Sir aapne c program pr kitne video bnaye hn
Complete C programming hai. www.learnbywatch.in par available hai.
well it is necessary to use int main() with return 0; in c++ ?
Seriously I didn't understand a thing!!! Which language did he speak? How did you guys understand him??? Wtf!
He spoke Hindi
National language of India 😊
🇧🇩
É U QUÊ ???
Title Kiya Likha h aur Ander kya h cheater
Right
😂😂😂😂😂😂😂😂
Bhai aap to gol gol ghuma rahe ho....
Sry, I don't speak indianish
kya bhakwas hai
Isse bakwas nhi ho skta
Sir ji void main k bare m to aapne bataye hi ni
Kya rah gaya? Poochiye
void means empty bro
What is lotal be😂
bal explain karo
Sir fake video na bnaya kre title kuch diya or explain kuch kiya fzul hi time zaya krty hain logon ka sirf viwes k loye
Apni apni samjh ka farq hai, nahi to video k like bata rahe hain ki jo title hai vahi bataya hai. Aur agar samajhna chaho to iske alava kisi aur video ki jarurat nahi padegi.
Sir void ka mtlb
void means empty
Lota ❌ lotal ✅
FALTU KI SAB BAT KARDI SIR KAM KI BAAT HI NAHI KI.
It is very simple bro,
Void main me hum koi bhi value return nahi kar sakte because uska return type void hai aur
Int main me hum value return kar sakte hai kyuki return type int hai.
Agar apko abhi bhi doubt hai to hamari channel par aakar comment jarur kare
Thank you .
bilkul bakwaas btaya h
thank you sir
Thank you Sir 🙏
+ER. AMIT's Knowledge welcome
Thank you sir..
+Geerisha Acharya welcome
well it is necessary to use int main() with return 0; in c++ ?
Thank you sir
Welcome