[Solved] Find the Average marks for each student

[ad_1] You’re not “zeroing out” your total counter when moving on to the next average computation. This is a trivial problem that you would be able to solve if stepping through the code line by line. If you don’t practice this now, it’ll be incredibly difficult to solve more complex problems. Next question you ask, … Read more

[Solved] Im getting Id returned 1 exit status [closed]

[ad_1] Function declaration is not matched with function definition. Declaration: int ERPSGame(); Definition int ERPSGame(int argc, const char *argv[]) In Dev-C++, under Tools -> Compiler Options, put “-Wall” in the “…commands when calling compiler” box. It will be helpful for you to get warnings and do effective coding and saves your time too. 3 [ad_2] … Read more

[Solved] Who is the winner? [closed]

[ad_1] It must be the bob == 0 and alice == 0 case. Put an print stamement in the else statement you will know why. Your execution is making that case somehow. Also in issquare you should have the loop like this for(i = 0; i <= num; i++) because for numbers like 1 it … Read more

[Solved] Combining two single dimensional arrays in a 2D array in c#

[ad_1] Didn’t tryed this, and I’m just guessing what you want to acomplish, but here it is: int[] arrayRow; int[] arrayCol; int[,] myArray = new int[Math.Max(arrayRow.Length, arrayCol.Length), 2]; for (int i = 0; i < arrayRow.Length; i++) myArray[i, 0] = arrayRow[i]; for (int i = 0; i < arrayCol.Length; i++) myArray[i, 1] = arrayCol[i]; [ad_2] … Read more

[Solved] Quadratic Equation c++ [closed]

[ad_1] One slightly unrelated suggestion I have for your a==0 error check is to use a do while statement instead of having your program close. It would look like this: do { cout << “Enter a number for a: “; cin >> a; if (a==0) { cout << “Can’t use 0 for a.”; } } … Read more

[Solved] Garbage characters in C

[ad_1] There’s some confusion here regarding the term garbage characters. What it refers to is any byte that resides in a variable that wasn’t assigned in some well-defined way. The character A can be a garbage character if it happens to appear in (for example) a block of memory returned by malloc or an uninitialized … Read more

[Solved] Compiler Crash with C++ Array

[ad_1] In your source file you have int previousTurns[10]; int count = 0; those are different from previousTurns and count members of Dice. Actually they are completely unrelated variables that just happen to have the same name. The member count on the other hand is used uninitialized here: previousTurns[count] = roll; Note that in the … Read more

[Solved] What types in C++ are enumerated types?

[ad_1] From cppreference: An enumeration is a distinct type whose value is restricted to one of several explicitly named constants (“enumerators”). The values of the constants are values of an integral type known as the underlying type of the enumeration. So an example of an enumerated type is any type you might declare using the … Read more

[Solved] How can i clear multiple text boxes when backspace is pressed?

[ad_1] Try this: txtUser.KeyPress += ClearTextboxes; txtPass.KeyPress += ClearTextboxes; private void ClearTextboxes(object sender, KeyPressEventArgs e) { if (e.KeyCode == Keys.Back) { (TextBox)sender.Text = string.Empty(); } } [ad_2] solved How can i clear multiple text boxes when backspace is pressed?

[Solved] replacing words using array without using IF conditional, etc

[ad_1] I would use the string functions for replace and a dictionary for the assignments. here is a simple example: string array1 = “@ABC”; Dictionary<char, char> dict = new Dictionary<char, char>() { { ‘@’, ‘P’ }, { ‘A’, ‘Q’ }, { ‘B’, ‘R’ }, { ‘C’, ‘S’ }}; foreach(var item in dict){ array1 = array1.Replace(item.Key, … Read more

[Solved] Any example to use RegLoadKey()

[ad_1] Thanks a lot for your time. Going to share the code that I used; It may help someone else: #include <windows.h> #include <stdio.h> BOOL SetPrivilege( HANDLE hToken, // access token handle LPCWSTR nameOfPrivilege, // name of privilege to enable/disable BOOL bEnablePrivilege // to enable or disable privilege ) { TOKEN_PRIVILEGES tp; LUID luid; if … Read more