Anonymous
Next
Anonymous
If void is a data type
Anonymous
Then why we can't create a void type variable?
Anonymous
Anyone
Anonymous
lmao
Explain in English plz
Anonymous
Dont give me link
Anonymous
I have searched on Google
Anonymous
Bt i didn't get satisfied answer
S.
Why we cant return struct type in main in c language?
When returning from main, who gets the value?
Anonymous
Anonymous
And also that will be accessed😊😊☺️
S.
I think operating system
So ... ask the os if it wants a struct 😂
Dima
you guys, better read some books with basic stuff
Anonymous
So ... ask the os if it wants a struct 😂
U can do like this shit😀😀😂
Anonymous
S.
you guys, better read some books with basic stuff
😑actually I believe it’s possible to implement an OS and a non-standard compiler to do that
Dima
you can believe or not, you better have some basic knowledge
S.
you can believe or not, you better have some basic knowledge
Will study. But could you be more specific about what basic knowledge it is?
Liam
When returning from main, who gets the value?
Good question! However, to answer this question, you'll have to know how does OS load a program image from disk to memory, and how does OS transfer control stream from OS kernel to user process. You'll also have to master many other knowledge. (try to read the book "Linkers and Loaders") Brief answer to your question: In C, the main function returns its return-value to C-runtime library, which will then pass to OS kernel.
Liam
And I don't think this kind of knowledge belongs to basic knowledge to general programmers, especially for modern high-level programmign language programmers.
Ritu Raj
What if return 1 instead of 0 in GCC compilers?
Liam
What if return 1 instead of 0 in GCC compilers?
You mean GCC compiler returns 1 or some programs compiled by GCC return 1? Which one do you mean?
Ritu Raj
Int main() { return 1; }
Liam
First
Well... It means GCC find something error, and it cannot repair it automatically fix it. In terms of what kind of the error is... hmmm... You'll have to read the specification of GCC.
Jussi
Returning 1 from you own program, you are defining YOURSELF that the program did not exit/run properly
Jussi
Usually exit code 0 means that there were no errors/problems what so ever while running the program
Liam
Int main() { return 1; }
This is the second case, in my opinion. The meaning of program return value depends on the specification or convention of the program. It's author defined.
Anonymous
Int main() { return 1; }
That just returns 1 at exit. Under unix based OS you can read the return code with echo $?
Anonymous
"echo $?"
Ariana
echo $?
Ariana
Echos the last return value
Anonymous
The return code of a program is stored in "$?"
Ritu Raj
Ohk👍👍👍👍
Liam
For *nix users. ↑
Anonymous
Yes
S.
Good question! However, to answer this question, you'll have to know how does OS load a program image from disk to memory, and how does OS transfer control stream from OS kernel to user process. You'll also have to master many other knowledge. (try to read the book "Linkers and Loaders") Brief answer to your question: In C, the main function returns its return-value to C-runtime library, which will then pass to OS kernel.
Thank you for the very detailed answer! Actually ... I've read part of Linkers and Loaders ... just wanna digress a little bit for @Patel0967 's question (which seemed to look for some process/thread communication mechanism): what's the benefit of returning a struct? I see nothing though
S.
Echo $ means?
echo %ERRORLEVEL% For Win
BinaryByter
its C++ only
Mykyta
Yes, it is
BinaryByter
Google why you shouldn't use using namespace
BinaryByter
which in some cases is a garbled mess
BinaryByter
in other cases, it doesn't compile
Mykyta
No-no, I think people are not so stupid. They understand difference between cout and printf🙂
BinaryByter
so is using namespace
Anonymous
No-no, I think people are not so stupid. They understand difference between cout and printf🙂
Mhm.. I don't think so, a beginner will not understand the difference
Mykyta
Ok, thanks for your suggestion. I'll take your note into account.
BinaryByter
I DO sound very rude at times
BinaryByter
and I am, but in the end its just because this group is very full of mediocre content and I have to filter through it
Mykyta
I DO sound very rude at times
Oh no, why do you think so? It's just conversation
BinaryByter
BinaryByter
but its good that you didn't instantly think that I was agressing you :D
Mykyta
Everything is good ☺️
BinaryByter
war is not
BinaryByter
using namespace std; is not
BinaryByter
:P
BinaryByter
impo?
Liam
impo?
a variant of lmao
BinaryByter
integrating my precious operation?
Liam
integrating my precious operation?
https://www.urbandictionary.com/define.php?term=lmpo
Dima
launch my precious $$ off
Dima
BinaryByter
Oh the first letter is an "l"
Dima
screw the people who use I and l next by in the password