49,757 Topics
| |
In straight-11 ping-pong, the first player to reach 11 points wins; the player need not be ahead by 2. Suppose that when Ada plays Blaise, Ada has a .56 probability of winning any given point. We want to write a program that simulates a game between Ada and Blaise, with … | |
Hi There, I hope somebody can help me, I work with Visual C++ 2008 with QT libraries I am trying to include a Interop.Encore.dll file into my program to access our ERP system business objects and post new data to the ERP We have a Visual Basic program geared to … | |
I wrote this code to sort 3 integers, but I can't figure out how to add the 4th integer. #include <iostream> using namespace std; int main () { cout << "Enter 4 integers: "; int a, b, c, d; cin >> a >> b >> c >> d; if (a<b) … | |
I was asked to create a program that enters numbers and displays the before sorting order, and the sorted order displaying the previous node address and the next node address. I was told not to swap the data inside the nodes, but move the nodes themselves. I have a problem … | |
ok so I have #include <iostream> #include <cmath> #include <iomanip> using namespace std; int main() { { cout << "****"; cout << "***"; cout << "**"; cout << "*"; } { cout << "*"; cout << "**"; cout << "***"; cout << "****"; } { cout << "*"; cout << … | |
write a program to store 10 numbers in an array and then display the sum of didits of the smallest number. | |
Hello all. I have a small web server that i am using in one of my projects. It is designed to receive a message when somone click on a link containing my ip address. Its used for a email verification/ de-verification. I can run this web server and then type … | |
Well Been working with winsock2, and trying to send POST request to my server but currently no luck with the packet header, so if anyone has a tutorial on how to do this with sprintf code sample: sprintf(Post_Request, "POST %s HTTP/2.0\r\n", Post_Request); sprintf(Post_Request, "%sContent-Disposition: form-data; name=\"field1\"; text=\"%s\"\r\n", Post_Request,text.c_str()); sprintf(Post_Request, "%sContent-Disposition: … | |
I'm doing a program where I need user to enter the name of a text file. I want him to be able to see the path if he enters pwd. Right now this is very OS related and only works on Mac OS(I guess). So I have done string real; … | |
Greetings! I was looking through this Rabin-Karp algorithm code. Everything is fairly clear to me, except those "-48" numbers (lines 13, 14 and 25)... So I was just wondering if anyone could explain, why are they used for? (maybe for string to int transformation?). Can you please explain it with … | |
Well my problem is on boardGenUSER I don't know why... it's print out the number 2 into the 0 row and 8th column :-/ I really stuck and i need points to continue please check out my code below and let me know... Thank you in advance!!! Regards #include <iostream> … | |
In desperate need of help! Can someone please show me how to simply display a pgm image in c++. I have no prior experience in multimedia programming. Thank you! | |
There is something wrong with this program. The code is ok, the program runs, but it stops after asking the user how much their income is. Where am I going wrong? (Sorry, it's really long, but I can't figure out where the problem is) #include <iostream> #include <string> #include <cctype> … | |
Hi, I found the examples of explicit specialization, but I have a vagueness about code: using namespace std; template<class T = float, int i = 5> class A { public: A(); int value; }; template<> class A<> { public: A(); }; template<> class A<double, 10> { public: A(); }; template<class … | |
I have a vector that contains Points on a board and I would like to do the following: 1) if a Point appears an even number of times i would like to delete all of the same Points. 2) if a Point appears an odd number of times i would … | |
Hi there, I am using MATLAB and am trying to mex a c++ file. I get a load of compiler errors and I am not sure why: correspondPixels.cc(57) : error C2065: 'Matrix' : undeclared identifier The line of code this relates to is: `Matrix m1, m2;` Now the class should … | |
| Yes, I know that this is homework. But I need help. This is code the teacher gave us few days ago. This is a header file. And I needed to do the following: My problem is that I didn't know how to use my vecetor in my .cpp file. How … |
I've been making a program for fun and I'm an amateur programmer too. I added a feature to a program that let's it read users externally from files to log in instead of storing user data on the code so that new users can register. I'm having problems in line … | |
Please i'm working on a linked list and want to overload the ++ operator in order to use a dummy pointer to loop/traverse through the list. But its gives me a compiled-time error. Here is the actual code: class Node { private: string value; Node* next; public: ~Node(){del ete this;}; … | |
Hello, Wondering if you can help me.. I have a variable, that each time needs to multiply by 2 (I know, it sounds simple.. I'm probably being an idiot) but it works like this: LOOP 1 offsetX = 0; offsetY = 0; LOOP 2 offsetX = 2; offsetY = 0 … | |
Hello im new to daniweb and c++ and am getting a overloaded function error on my readFile function, specifically the string data type. I cant seem to pinpoint whats causing the error. Im supposed to use the function to read data from a text file in this format: Johnson 5000 … | |
I am trying to create a 2 dimation array for a game... The table will look like that!!! **0 1 2 3 4 5 6 7 ** **0|0 0 0 0 9 0 0 0 ** **1|0 0 0 0 0 0 0 0 ** **2|9 0 9 0 0 … | |
i have a vector of points (yeah the one from the last thread) it has no duplicates and those points configures the outline of a shape (tetris shape) the problem is that i want to sort them inside the vector in a circular way . i mean if u take … | |
I am getting this error with when I compile. I have to turn this assignment in in a few hours. Here is the code: error message(s) untitled.cpp:34: error: invalid types ‘int[int]’ for array subscript untitled.cpp:36: error: invalid types ‘int[int]’ for array subscript // A basic Casear Cipher Encrytion Device. #include … | |
I'm writing a program and am getting both an LNK2005 and LNK1169 error. I might be doing something wrong with trying to call the various files as this is the first program Ive tried writing with more than one. I was given a .h file to begin with that I … | |
Hello, I've been having a little dificulty with passing this array to my text file. What i'm doing is writing a questionaire type quiz which involves outputting questions, receiving input, and taking each input value and listing it in a text file. What I have works, except for writing the … | |
I'm trying to write a program that calculates the mean and standard deviation for a set of numbers. I broke the calculation down into a couple parts, and for some reason when I try to sum the differences squared I keep getting the wrong answer. Not sure why though. For … | |
Hello, I want to load integers from a text file into a class or structure. It should jsut read all lines and load them into it. What is aa easy code for this? I want to keep it simple and easy. Also it should be easy to modify, like modify … | |
This is what I have. It displays the 100, which is what 10 times 10 would be, but I want it to show a multiplication table. My Nest For Loop works fine doing the same thing but I can't get this to work properly. Can anyone help? { int row=0; … | |
So first of all let me say I am pretty new to C++ and find it very difficult to learn (especially when compared to say C#) Anyway I am working on a program that requires the use of a 2D array or a similar container. After talking with a professor … |
The End.