49,761 Topics

Member Avatar for
Member Avatar for 0xe9

On windows XP (compiling with visual studio 2008) my calls to open thread result in the following error code: OpenThread() failed: 5 I cant figure out the problem, nor what error code 5 is? Any help is appreciated :) EDIT: Then if i change my OpenThread call to: OpenThread(THREAD_SET_INFORMATION, FALSE, …

0
42
Member Avatar for Afaq Haider

Hi, Friends plz help me to Convert infix expression to postfix expression using stacks (simple C++ program), I m new to c++ so i don't knw too much abt c++, write a simple program for me, i have just five days more for submitting my assignment, so plz help me, …

Member Avatar for boiamz
-1
117
Member Avatar for noey699

I cannot figure out what is wrong with this collision detection code. ballx1 and bally1 is the current position for the ball ballx2 and bally2 is the position of the ball one step before paddlex1 and paddley1 is the current position of the paddle diry is the direction of the …

Member Avatar for mrnutty
0
80
Member Avatar for Qmage

The do...while loop works fine when i key in only single character, however if i key in multiple characters, the default statement is executed infinitely. I think the problem lies in cin >> int?, i need some help in modifying the code, thx [CODE] bool rightanswer = true; do { …

Member Avatar for Qmage
0
87
Member Avatar for Gem74

I am getting 3 error messages: -cannot convert from 'const char [2]' to 'char [10]' 2messages of: 'char secretType::setName(char)' : overloaded member function not found in 'secretType' #include <iostream> #include <cstring> using namespace std; class secretType {private: char name[10]; *error message here int age, weight; double height; public: char setName …

Member Avatar for dkalita
0
99
Member Avatar for shamila08

[code=cplusplus] #include <iostream> #define MAX 100 int num[MAX]; int n; int nrows = 0; using namespace std; void print() { if (num != 0) { for (int j = 0; j <n; j++) cout << num[j]; cout <<"\n"; } } void leftRotate ( int n) {int tmp; for(int k =1; …

Member Avatar for mrnutty
0
259
Member Avatar for zahra81

These Questions from a pervious exam i need your help to solve it: 1- Write a C++ program that uses a function called calcPay( ) to calculate the total wages of an employee. The total wages are calculated as follows. Total wages= (number of hours worked in a week*hourly pay …

Member Avatar for mrnutty
-1
100
Member Avatar for brich744

Hello Everyone, This program is designed to tell you the probability of winning the Lotto. I am having problem with using the recursive factorial function inside of the function computeWays. I am getting just the numbers of picks for the chance of winning. For example if I enter in 12 …

Member Avatar for rOKi125
0
96
Member Avatar for ravenrider

Hi guys I have been trying to figure out the problem with this program but i couldn't. my program basically crahes everythime I run and I get a seg fault. I tured in as is, but for learning purposes I want to know what's wrong with and how I should …

Member Avatar for mrnutty
0
108
Member Avatar for NinjaLink

I need help trying to convert a postfix expression to Infix. I have tried to search books and internet material to help me take on this task but no luck. Below is what I created, but I know it is far from right which is why I appreciate if someone …

0
90
Member Avatar for infern0

Hi, I'm having trouble writing a program that asks the user 3 questions.(3 possible answers for each) I am using a string to remember all the answers with a getline(cin,answer) statement. My problem is the first two questions have choices for the answers that can be the same such as …

Member Avatar for mrnutty
0
115
Member Avatar for bpt0004

Hi everyone this is my first post, i've been browsing for awhile and finally decided to join. I'm having trouble with an assignment i have in class. I need to calculate the euclidean distance between two 2d vector. The function takes in two 2d vectors of integers. I'm also having …

Member Avatar for bpt0004
0
2K
Member Avatar for chaybird001

I am doing a homework assignment for c++. I am able to get my program to run, but I don't know how to modify it for my next assignment. Here is the question. Modify the program so that various comments are printed for each correct answer and each incorrect answer …

Member Avatar for chaybird001
0
203
Member Avatar for power_computer

As seen in my previous post I had a problem with some code dealing with linking a template class, I emailed my professor and the g++ compiler cannot handle the seperate compilation of template classes. So now im stuck with no compiler, in labs we use the CC compiler with …

Member Avatar for power_computer
0
154
Member Avatar for s11049151

Hi Friends, Can you please help me write 3 functions in C++. It's based on a 2 dimensional linked-list The 3 functions that i have left to write are: [B]1.get_data: If data retrieval is successful return true otherwise return false. 2. update_data: This function updates the data located in the …

Member Avatar for Labby Tisha
0
553
Member Avatar for tina05

somebory can tell me how to swap two colum of the two dimentional array that with pointer this is the run I did but do not work I was in function swap 0 0x11 0 sh: pause: command not found I was in destructor *** glibc detected *** ./a.out: free(): …

0
43
Member Avatar for power_computer

I currently have a template class, another class that is passed as the parameter to the template and a driver and I am getting these errors, I have no clue what the problem is. Also I have another issue with this project I need to sort out which is insert …

Member Avatar for power_computer
0
260
Member Avatar for spookyfish

Im tasked with developing a simple blackjack program for a class. The program I have currently compiles and runs but it isnt paying out properly. A blackjack (21) should pay out 1.5*the wager, but it is doing it more than it should. Here is the code I have. [CODE] #include …

Member Avatar for spookyfish
0
6K
Member Avatar for gretty

Hello I have 2 ways to delete a linked list, which one is correct? If I have this linked list: [QUOTE] list = 1 - 2 - 3- 4 [/QUOTE] Which function will delete list correctly? 1. [CODE] void destroy(node * & list) { while (list != NULL) { delete …

Member Avatar for gretty
0
76
Member Avatar for vitvar

Hi i am trying to write a function in C which will print a substring oout of a string in loop with a token seperator. For example i have a file which contains the following lines aaaaa bbbbb ccccc ddddd i have to read each line and then copy to …

Member Avatar for vitvar
0
184
Member Avatar for avi_2009

Hi Guys: I am trying to build a simple application to query a REST web service. I have developed a perl script and its working fine. I have also developed a java app which does the same thing. Just wondering if C++ can be used for it. I did not …

Member Avatar for mahatmagaga
0
171
Member Avatar for darkpeakjim

Hey guys, I'm reading data from a text file into a vector of strings and would like to pass these strings as parameters to a function. To be clear, I don't want to pass the actual strings as parameters, but the variable with the name which corresponds to the contents …

Member Avatar for darkpeakjim
0
86
Member Avatar for 0xe9

Hey, is it possible to package a C++ an application in vs2008? There is no publish option that i can see like there is if you're developing in C#. The problem i'm having is every time i copy my exe file from the release folder, then run it on a …

0
43
Member Avatar for poopynoob

I am trying to read the value of memory address using c++. For example, how can I read the value contained in "00B12318"? I have tried: [CODE]int value; 00B12318 = &value; cout << value;[/CODE] But sadly it doesnt work. Please help! THank you :(

Member Avatar for poopynoob
0
93
Member Avatar for kadji.kahn

I was asked "This program should calculate which of four company divisions had the highest sales for the last year. The program should ask for the annual sales for the four divisions. The function should calculate which division has the highest amount in sales and return that amount to the …

Member Avatar for kadji.kahn
0
147
Member Avatar for banks2140

I need help with my programming assignment which states A mail-order house sells five different products whose retail prices are as follows: Product Price 1 $2.98; 2 $4.50; 3 $9.98; 4 $4.49; 5 $6.87. Write a C++ program that reads a series of pairs of numbers as follows: a) Product …

Member Avatar for restrictment
0
104
Member Avatar for PDB1982

I trying to create a program that deals with money, and have it all figured out except one portion...I can't get all the decimals to have a monetary look, meaning only two decimal places. I know I can setprecision(2), and that would work for most numbers, but what if the …

Member Avatar for restrictment
0
108
Member Avatar for walter clark

The clock() function works fine in Visual C++ Version 6. I used it for evaluating how many milliseconds certain functions needed. But with Version 8 it won't let me use time.h the library that holds clock(). Naturally the error is unreadable, but there's hundreds of them and its obviously complaining …

Member Avatar for walter clark
0
108
Member Avatar for Poopster01

this is the simple problem I'm working on. A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $0.50 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24-hour period …

Member Avatar for Poopster01
0
149
Member Avatar for NinjaLink

I had another thread before this one, but I felt that it was getting too long. Current problem: My operator== is not working properly in my program. I have done some things in my function, but I don't think it is "completely right". My program compiles fine and the output …

Member Avatar for Tom Gunn
0
1K

The End.