[Solved] Why isn’t C++ inheritance in multiple header and source files working?

You have a cycle in your header inclusion: MainProgram.h includes FileMgr.h FileMgr.h includes MgrBase.h MgrBase.h includes MainProgram.h You need to break this cycle using forward declarations. The rule in header files should be: if you only need to declare reference or pointer to a type X, forward declare X instead of including the header which … Read more

[Solved] C error: Exited with non-zero status

gets returns char*. In this context – It is wrong to write char *[] in the function definition where you are supposedly passing a char array where input characters are being stored using gets. Also char *gets(char *str) – you need to pass a buffer to the gets where the inputted letters will be stored. … Read more

[Solved] What is the output of this C code (run without any command line arguments)?

Quoting shamelessly from the C11 spec, chapter §5.1.2.2.1, (emphasis mine) — The value of argc shall be non-negative. — argv[argc] shall be a null pointer. — If the value of argc is greater than zero, the array members argv[0]through argv[argc-1] inclusive shall contain pointers to strings, which are given implementation-defined values by the host environment … Read more

[Solved] I can not input the names into the char array using scanf

By char *stdnames[100]; you got an array of (pointers to char). The NEXT BIG QUESTION is Who will allocate memory for each of these pointers? A small answer would be – You have to do it yourself like below : stdnames[count]=malloc(100*sizeof(char)); // You may replace 100 with desired size or stdnames[count]=malloc(100); // sizeof(char) is almost … Read more