49,761 Topics
| |
OK, I've seen this error explained at least 100 times on the net. But in every case, it seems to be an error of #including <string.h> instead of <string> or metioning string instead of std::string. But, I've done all those things. And it still does not work. By way of … | |
#include<iostream> #include<cstdlib> using namespace std; int main() { srand(21); cout << "Unique numbers:"; for (int x = 1; x < 10; x++){ cout << 1 + ( rand () % 20) <<endl; } system("pause>0"); return 0; } Guys this is my program. Can i ask if how can i vertical … | |
I need help to display on the screen rock when user picks rock, paper when user picks paper, and scissors when user picks scissors. Thanks | |
C++ Programming Exercise: Implement a command-line calculator that allows the user to enter an expression containing numbers, variables, brackets, and operators. The calculator will also allow assignments to a variable. After the user enters the expression the program will evaluate it and display the value. If the expression is part … | |
hey guys i was solving a question but there is something which is not working properly.. I'll provide you guys with question statement and my code below.The problem is occuring after the loop like if the avg is more then 0 still it shows the output massege as "terminating". Can … | |
im looking to brush up on my C++ coding as its been a quite a few months since ive done anything with it and ive run into a snag with my coding and have spent hours with 2 Compilers (Bloodshed Dev C++ (where code was originally written)as well as Eclipse … | |
Please help. I really think I'm close to getting this. No I'm just banging my head against a wall. I have to replace a nested if statement with a switch statement. The loop should continue until Z or z is entered. I can't figure out what I'm doing wrong. #include … | |
| Hey guys, I just learned the very basics of arrays and I have to write this program of a tic-tac-toe game. The requirements are this: Write a modular program that allows two players to play a game of tic-tac-toe. Use a two-dimensional char array with 3 rows and 3 columns … |
I am developing Client-Server application in C++ using Qt framework, but the clients can be android phones and computers(Qt client app) Now i'm having troubles to handle Reception of data on the server side; the server is not receiving data properly. First, I got things working nicely between the server(Qt … | |
i have notice that using the joyGetPosEx() function, when the joystick isn't connected, that the memory, that the application uses, is increasing. so is there another way just for see if 1 joystick is connected to pc? | |
How can i create a rounding off program using ceil, floor, srand and rand... thanksss | |
The following code creates a Sorting Array using Pointers and functions correctly. The issue I have is I want the array to sort, but put the zeros at the end. Any help would appreciated. #include <iostream> using namespace std; #include <iomanip> using std::setw; void selectionSort( int * const, const int … | |
SCENARIO You must type in a list of numbers and make sure that in the list, there are no identical numbers; in other words, no number must appear twice in the list. When entering a new number, make sure that the number does not exist in the list yet. If … | |
What is the output of program segment: vecList: push_back(3); vecList: push_back(5); vecList: push_back(7); vceIt = vceList.begin( ); ++vecIt; vecList.erase(vecIt); vecList.push_back(9); copy(vecList.begin( ), vecList( ).end( ), screen); cout << end1; | |
Hi Guys, In below code you can see that i am able to execute the functionality of class a , inside the class b through composition and object of b can be used to call the methods declared inside the a class. #include <iostream> using namespace std; class a { … | |
All of us started from being a rookie, and I'm one of those rookies who are new in this course. Maybe its time for you to share your expertise unto the newbies? Hope anyone might help me willingly in my program.Here's the problem: Use Pointers and Functions: Ask a user … | |
How do I write a recursive function to compute (3^2)+(3^3)+(3^4).......+(3^n) ? | |
Hi guys, I would like to discuss my design with one query. below is the code snippet. It is clear from below code snippet that class pd is privately derived from AbstractClass as both are different classes and there is no relation between them.Now in my class pd i need … | |
Greetings: I have been struggling to clear this error I have in my code, but I cannot for the life of me find it. Error: End of File detected before Left Brace Attached is my code, appreciate any help. #include <stdio.h> #define SIZE 20 int i, j; int temp[SIZE], pressure[SIZE]; … | |
How do I write a program to compute run-time of a recursive and non-recursive functions to find the 43rd Fibonacci number? | |
Hey everyone, Got 2 questions here that i'm hoping will be answered. Say i have 2 variables int iValue; int iValueArray[300]; and later on init. them in the constructor Banana::Banana(): ival(0), ivalArray() {} 1. What would the ivalArray() indicate? Would it be the same as initializing every element to null/empty? … | |
I'm not sure if I'm doing this part correctly, the part where I have to make it all lower case then to all upper case, then just first name. #include <iostream> #include <cstring> #include <stdio.h> using namespace std; int main() { char a[3][14] = { "Barack ", "H", " Obama" … | |
Hey everyone! So I need to write two header files and they attach to the main cpp file, but we can not change the cpp file. They have to attach and make the program run. Please help! Main cpp CANNOT be changed! //22 34 56 4 19 2 89 90 … | |
`Inline Code Example Here What is the output of the following code: int x; int*p; int*q; p = new int [10] ; q = p; *p = 4; for (int j = 0; j<10; j++) { x = *p; p++; *p = x + j; } for (int k = … | |
Why can we virtual destructors but can't have virtual constructors? I have searched like anything. I got confused a lot after reading few articles on web. Please explain with some good example. Thanks in advance. | |
I have just finished a merge and sort code for two seperate files. My two inputs are: File 1 Adams C Benton A Jones D Haley A King B Margaret F File 2 Barnes A Charles B Johnson C William D and it keeps doing this for my out put … | |
I'm having some trouble attempting to implement the constructors for each class. I have this constructor for the class Transaction. Is this correct ? Transaction::Transaction(QString type, QDateTime datetime) : m_Type(type), m_DateTime(datetime) { } AND how do i implement the constructor for the class Deposit ? Is this correct ? I'm … | |
Hi all.. I saw a part of codes which I unable to understand.. pleaase all the expert teach me ya.. below is the part of codes.. UINT A; USHORT B; USHORT *C; CString D; if(!sscanf_s(D, "0x%x", &A)) sscanf_s(D, "%d", &A); *(C + B) = A; //<= what is the meaning..?? … |
The End.