49,757 Topics

Member Avatar for
Member Avatar for jojodeco

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 …

Member Avatar for Eagletalon
0
550
Member Avatar for Eagletalon

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 …

Member Avatar for Eagletalon
0
3K
Member Avatar for FraidaL

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) …

Member Avatar for TrustyTony
0
3K
Member Avatar for cryonize

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 …

Member Avatar for TrustyTony
0
9K
Member Avatar for hk3008

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 << …

Member Avatar for Eagletalon
0
92
Member Avatar for tiger009

write a program to store 10 numbers in an array and then display the sum of didits of the smallest number.

Member Avatar for Kevin Loyed
-1
61
Member Avatar for jonnyboy12

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 …

0
59
Member Avatar for ilearnz001

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: …

Member Avatar for Ancient Dragon
0
123
Member Avatar for enkitosh

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; …

Member Avatar for enkitosh
0
266
Member Avatar for GillBates

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 …

Member Avatar for Ancient Dragon
0
71
Member Avatar for poolet

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> …

0
87
Member Avatar for nikesh22

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!

Member Avatar for stereomatching
0
129
Member Avatar for FraidaL

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> …

Member Avatar for FraidaL
0
104
Member Avatar for MrEARTHSHAcKER

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 …

Member Avatar for MrEARTHSHAcKER
0
192
Member Avatar for Despairy

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 …

Member Avatar for mike_2000_17
0
92
Member Avatar for dinners

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 …

Member Avatar for dinners
0
196
Member Avatar for zios007

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 …

Member Avatar for sergent
0
140
Member Avatar for funkey100

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 …

Member Avatar for histrungalot
0
365
Member Avatar for capton

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;}; …

Member Avatar for capton
0
192
Member Avatar for phorce

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 …

Member Avatar for phorce
0
114
Member Avatar for slaythezeppelin

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 …

Member Avatar for rubberman
0
163
Member Avatar for poolet

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 …

Member Avatar for poolet
0
141
Member Avatar for Despairy

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 …

0
77
Member Avatar for usernforce

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 …

Member Avatar for MastAvalons
0
151
Member Avatar for benswimmin

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 …

Member Avatar for JasonHippy
0
122
Member Avatar for codecrypt

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 …

0
63
Member Avatar for kkb08

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 …

Member Avatar for nullptr
0
150
Member Avatar for Torf

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 …

Member Avatar for Torf
0
192
Member Avatar for itsanicole

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; …

Member Avatar for Lerner
0
375
Member Avatar for JOSheaIV

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 …

Member Avatar for JOSheaIV
0
3K

The End.