Vladimir
No, Sir, plz, no, it's not valid, it's terrible
Usually it works, and it's not that terrible. Many ppl write this way
Anonymous
Bcoz..it has to send status code to os... When os make a function call that is calling main function
Anonymous
So status code 0 means.. everything is fine
Vladimir
Its not work
Just checked for sure, it works.
Anonymous
And nothing is wrong
Astral
What make a status code
Anonymous
No
Yes bro..it changes
Astral
Int before main()?
Till
Just checked for sure, it works.
No work, I check on specific compiler
Daniele°
Simple return "random" value with void main
Anonymous
Int before main()?
Return 0 0 is status cose
Anonymous
Code
Daniele°
Anonymous
Simple return "random" value with void main
Hey.. Program has to send status code to os..after execution of main function.. And status code is integer..how void can return int..?
Daniele°
because return value Is set in register
Anonymous
Void main is treated as int main at backend..while execution of program.. That is I know
Vladimir
Let's discuss a better question. Why 25? Random value? Why not changes?
Anonymous
I'm here new & noob for programming.... Any guidance
Anonymous
Please show code
Vladimir
Well clang raises warning by default, but compile anyway
Vladimir
Please show code
Code is shown on screenshot
Daniele°
Well clang raises warning by default, but compile anyway
Try to call a function inside main will return 0
Daniele°
int test(void){ return 0; } void main(){ test(); }
Daniele°
😊
Vladimir
👍
Victor D.
No, Sir, plz, no, it's not valid, it's terrible
That's what i said in the last sentence
Victor D.
By standard, use int main(int argc, char* argv[])
Ravi
How to write c code without main
Ravi
?
kλletaa
Ravi
why do you want that
Now just I raise the que
Ravi
It is possible or not
Ravi
?
kλletaa
it's possible but why do you want that
Oleksandr
блять такое ощущение что иностранцы в гугл не умею в упор it is possible
Oleksandr
u can crate lib, o just 1 module for ur program
Oleksandr
so, u can write code without main, but NOT PROGRAM
Ravi
You can find the code
Oleksandr
Imagine Lego
klimi
Delete it
Oleksandr
u can createa a lot of parts for "Castle" without main
Ravi
Sorry in can't understand
Oleksandr
but it will works only together
klimi
You trying to get a building with no doors
klimi
There is no entry
Oleksandr
file.cc void foo() { printf("google.com что б вас"); } main.cc int main(int ac, char **av) { foo(); return 0); }
Oleksandr
u have 2 files
Ravi
Ok
Oleksandr
u can use file.cc for many programs
Oleksandr
but this is only a chain
Oleksandr
it will works only with main function
Oleksandr
without main this is only a part of possible program in future
Ravi
Thank you.
Ravi
I understand
Oleksandr
u'r welcome
Oleksandr
No
I can find the answer on the first link in google results. Are you sure?)
Oleksandr
Do you care only about this?
klimi
Yes
kvark
Do you care only about this?
u can just translate it)
kvark
but everybody in chat will hate you...
Oleksandr
Well, there are a lot of ours ...🌚
Roxifλsz 🇱🇹
Well, there are a lot of ours ...🌚
Tbqh a russian takeover of the chat is preffered to an indian takeover of the chat