3,118 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
Best practices
0
votes
10
replies
229
views
What errors do other return codes indicate from main()? return 1? return 100? Is there a standard?
The main() function returns a code stating back to the operating system.
0 if the program executed successfully.
any other number to indicate failure.
Moreover, if you write:
int main(){
}
The ...
0
votes
1
answer
79
views
Run time error related to main method error
I'm currently studying Java in general and inheritance in particular.
When I run the code below in an online editor it throws an error related to the main method, however, when I modify it as ...
2
votes
2
answers
256
views
Is there a Rust alternative to the GCC __attribute__((constructor)) and __attribute__((destructor))?
I have a function that I would like to call before my main function in rust:
fn init_stuff() {
// do stuff
}
and I was just wondering if there was any equivalent to the __attribute__((constructor)...
9
votes
1
answer
408
views
Is there a way to have a short and two long command line argument alternatives for a parameter?
I have guessed multiple syntax variations to achieve this in a single line in the MAIN function. I know I could achieve it in two separate lines, but am looking for the cleaner solution and only ...
-4
votes
1
answer
106
views
Need for encapsulating main() [closed]
Since main() is made static so that JVM can access it without creating an object of the class in which it is defined, then what is the need for writing it in a class?
0
votes
1
answer
338
views
How to set up a java module to run directly (not via a .jar file) without having to specify a main class
How does one set up a java program that can be run as a module simply by doing java -m mymodule?
I know this is possible because I have seen it in, e.g., the jwebserver documentation; you can run this ...
0
votes
1
answer
436
views
invalid command name 'main:app' when I execute "uvicorn main:app --reload" [duplicate]
When I try to execute the command uvicorn main:app --reloadfor start my local server, the VSCode terminal throws the error invalid command name 'main:app'. The code below imports a variable from the ...
-1
votes
1
answer
154
views
Why am I getting error: "C2731: 'wWinMain' : function cannot be overloaded"?
I am getting this error in my program :
error C2731: 'wWinMain' : function cannot be overloaded
at this line:
int APIENTRY wWinMain(_In_ HINSTANCE hInst, _In_opt_ HINSTANCE hprevInst, _In_ LPCWSTR ...
0
votes
0
answers
68
views
How to resolve "Entry point Not Found" in release mode
I am developing one DLL in VC++ and its working while testing with my Test.exe app in debug mode. But while running Test.exe in release mode I am getting "Entry point Not Found" error
While ...
0
votes
1
answer
162
views
Why the name of the entry point in top level statements is "<Main>$" and not "Main"?
When we use top level statements in C# 9 (and later), where we can omit static void Main(string[] args) and internal class Program, our program does not begin at the Main method; but rather, <Main&...
0
votes
0
answers
83
views
Best approach for displaying license activation dialog
I have a text editor, now I'm implementing licensing support. Licenses are managed on a third-party server (SAAS).
Desired Flow
The user opens the editor.
If they have no license (first-time open):
...
-1
votes
1
answer
180
views
Exiting back to main menu
I am currently writing a basic program with multiple menus. I have a function called menu1(), which is called in main and handles the first set of menu options. My issue I am having is being able to ...
0
votes
0
answers
80
views
Python GUI runs separate scripts through subprocess calls, but doesn't work when packaged as .exe
I have an interface I've created called interface.py that runs a script based on the press of a button...
def submit_action(selected_item):
values = list(item_to_value[selected_item])
...
-1
votes
1
answer
116
views
Does every translation unit need to have a main function? [closed]
I have been reading the 2nd edition of A Tour of C++ by Bjarne Stroustroup and in section 3.2 on Separate Compilation, he mentions translation units.
A .cpp file that is compiled by itself (...
0
votes
1
answer
94
views
Should Portable Types Be Used in the Declaration of a Main Function? (C11)
This question came to me last night, and I couldn't find a definitive answer in my brief surf of Google. Should (or could) I use portable types (i.e int32_t) in the declaration of my program's main ...