49,757 Topics

Member Avatar for
Member Avatar for stefanief

[QUOTE]I have an assignment that requires me to use an array, menuList, of struct menuItemType with members string menuItem and double menuPrice. I have to display the menu, let the customer order, total the bill including tax and print the check. Function getData had to load the data into the …

Member Avatar for stefanief
0
216
Member Avatar for StaticX

Hi i have a question about inputting to char*. For instance,i have made a class "Name",and am passing my constructors in as follows [CODE] Name* n1 = new Name("Nelly the elephant"); [/CODE] [CODE]Name::Name(char* name){ this->name = name; }[/CODE] But i am confused as to how i would code my addName().Ideally …

Member Avatar for StaticX
0
168
Member Avatar for rrvs331

I have a blackjack game(console game with visual c++), and I was wondering, how do I put in multiplayer?

Member Avatar for SgtMe
0
112
Member Avatar for CodyOebel

Compiler: DEV BloodShed C++ (latest release) I am following this windows api tutorial and am at this step [url]http://www.winprog.org/tutorial/menus.html[/url] [CODE] //FILE: resource.h // the below code is in a resource.h file // as stated in the instructions. #define IDR_MYMENU 101 #define IDI_MYICON 201 #define ID_FILE_EXIT 9001 #define ID_STUFF_GO 9002 [/CODE] …

Member Avatar for CodyOebel
0
144
Member Avatar for abhi_iips

why subscript operator ([]) must be overloaded in member function?? one may say that because it will take one argument , but operation needs two operands...one the base address and second is index(offset). cdnt it be , if cd have been treated like binary operator as well like this class …

Member Avatar for programmersbook
0
69
Member Avatar for Annettest

Hello everyone: I am a C++ newbie. I aim to use C++ in my work on coupled fluid flow-chemical reaction problems. I would very much appreciate some help to get me on the right track! I apologize in advance for what is probably a very simple question. My goal is …

Member Avatar for Annettest
0
272
Member Avatar for pecet

Looks like I miss something, so I need your help, guys. [CODE] #include <iostream> using namespace std; int main() { int* ptr=new int(2); const int* constPtr=ptr; int** ptr2; //... do memory stuff for ptr2 const int** constPtr2=ptr2; typedef int** intPtr; const intPtr ptr3 = ptr2; return 0; } [/CODE] Questions: …

Member Avatar for pecet
0
159
Member Avatar for Sorb3t3ro

How to open c++ using the command prompt so that I can start programming in c++? Thanks!

Member Avatar for zobadof
0
3K
Member Avatar for viswanathgs

I declared a map of the form [CODE]map<pair<int,int>,int> net;[/CODE] and inserted elements in the following way [CODE]net.insert( make_pair( make_pair(c1,c2 ),cost ));[/CODE] I could access the second element (cost, in the above code) using iter->second. But, I want to know how to access the two elements that form the first pair …

Member Avatar for programmersbook
0
72
Member Avatar for zobadof

I have started to learn C++ and would like to know where to go from now. I have been getting helped by MattyRobot. I have done Hello World, Input, Sqaure of Numbers, Making decisions, Cmd games, Operators, Repeated question and started to make a window. I would like some help …

Member Avatar for SgtMe
0
178
Member Avatar for .:Pudge:.

I am trying to read the contents from the specified file into a char array and then send that to the client. The problem i get is that getline() wont take a char array as a parameter and strcat() wont take a string as a parameter so I dont know …

Member Avatar for programmersbook
0
125
Member Avatar for otan

Write a program to assign passengers seats in an airplane. Assume a small airplane with seat numbering as follows: A 1 2 3 4 5 B 1 2 3 4 5 C 1 2 3 4 5 D 1 2 3 4 5 E 1 2 3 4 5 The …

Member Avatar for jonsca
0
1K
Member Avatar for ShooperMAN

Sorry, my first post on this forum is a question, but I'm pretty confused about this. There's a few steps in my question, and I'm confused about several. So, here we go: [CODE]baseClass *base; derivedClass *derived; base = (derivedClass *) malloc(sizeof(derived)); memcpy(base, derived, sizeof(derived);[/CODE] Would the memcpy statement work? Would …

Member Avatar for ShooperMAN
0
70
Member Avatar for halluc1nati0n

I'm trying this in Visual Studio 2005 (VC++) [CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> #include <bitset> #include <sstream> #include <conio.h> #include <iostream> using namespace std; #include <time.h> string tot_msg, message, to_be_sent_msg, sent_msg, msg_to_be_sent; char * transport_layer_data_header; char * transport_layer_data_msg; bool whole_msg_sent=false; int actual_len, i, seq_num=0; char * mynode = "2"; …

Member Avatar for mrnutty
0
249
Member Avatar for ROTC89

so i wrote a program that is suppose to have a array that has random numbers in it. sort the array, and then do a binary search and interpolation search to find the number and how many comparisons it took. i get it to work sometimes but the comparisons are …

Member Avatar for mrnutty
0
125
Member Avatar for kavourdoukos

[CODE]#include <iostream> #include <ctime> #include <cstdlib> #include <string> #include <vector> #include <fstream> #include <algorithm> using namespace std; class letter{ private: int genre; int price; string adress; public: letter(); ~letter(); }; class parcel{ private: int genre; int price; string adress; public: parcel(); ~parcel(); }; class post{ private: letter** LETTERS; parcel** PARCELS; …

Member Avatar for mrnutty
0
113
Member Avatar for Adnan Saleem

i am currently making a project in Data Structures which checks similarities between two c++ source codes....i am going to use the tokenization approch to do it.... [U]but i am having trouble in finding an efficient way of parcing source code [/U]so that i can turn it in the form …

0
65
Member Avatar for Amawri

Hi everyone. I'm a reta-I mean a beginner and 98% of my bugs are something really obvious... but I've checked this so much and I don't know what to do. This is my function to create an Employee object, called when the user wants to add a new employee to …

Member Avatar for UberJoker
0
230
Member Avatar for dvbrooks

I am trying to draw a hollow square and I am having a problem with nesting while loops within while loops. Is this possible? The quoted part of code is the trouble part. #include <iostream> using namespace std; int main(void) { int sides, t=2, h=0, b=0, s; cout<<"Size of square: …

Member Avatar for dvbrooks
0
72
Member Avatar for amanda2131821

I have this code that uses epoll and it has a problem. When I run it, it gives output: Server-socket() is OK... Server-bind() is OK... 3 4 accept: Invalid argument I'm running it on ubuntu linux, system updated, both as limited user and root what is wrong with the input …

Member Avatar for programmersbook
0
156
Member Avatar for vishesh.verma

Its showing size of type is unknown or zero [code=c++]#include<conio.h> #include<stdio.h> #include<graphics.h> #include<iostream.h> #include<math.h> int gc,gd=DETECT; int x[3][4],tx,ty,i=0; float turn[3][4]; void draw() { moveto(x[0][0],x[1][0]); for(i=1;i<4;i++) { lineto(x[0][i],x[1][i]); x[2][i]=1; } lineto(x[0][0],x[1][0]); } void rot() {double ang; float rot[3][3]; cout<<"enter the angle through which u want to rotate the figure\n"; cin>>ang; rot[2][2]=1; …

Member Avatar for StuXYZ
0
78
Member Avatar for Chikky

I have an assignment to write an ATM program (it just needs to be basic) and I am getting one error when I try to compile: On line 28, I get an `expected unqualified-id before '{'`. I don't know that it's the only thing wrong with it, but any ideas …

Member Avatar for UberJoker
0
735
Member Avatar for papanyquiL

I made the following function for my Sudoku solver but the answers keep turning out wrong (some of the numbers are showing as doubles right next to eachother). Can somebody help please? [code=c++] void reduction_candidateLines(void) { /* * declarations */ //drives loop int k, j, x, y, z, t; //counts …

Member Avatar for mrnutty
0
154
Member Avatar for KRal

/*This is an assignment for school. The main is part of the assignment. The program will work sometimes, sometimes it will not count the longest word if it is at the end of a sentence.*/ #include<iostream> using std::cout; using std::cin; // Prototype for the longest_word function that you need to …

Member Avatar for KRal
0
95
Member Avatar for rmcummings

I can not get the program to read the entire sentence. The main is part of the assignment. Any suggestions would be a great help! [CODE]#include<iostream> using std::cout; using std::cin; // Prototype for the longest_word function that you need to write. // Add consts where necessary to obey the principle …

Member Avatar for Murtan
0
106
Member Avatar for nemgod

Hello all and thanks for reading my post. I am trying to compile the winamp plugin NSFPlug which allows for NSF (Nintendo Sound Format) files to be played back through wniamp. I am actually more interested in the stand-alone version called NSFPlay which simply emulates winamp and uses the NSFPlug …

0
80
Member Avatar for infern0

Here is the piece of code I am having problems with. It is supposed to let me look up any items I put in the program previously. If the user did not enter a product earlier it should say "product not found". My problem is that it remembers the first …

Member Avatar for Murtan
0
107
Member Avatar for darkwing229

HI everyone! I'm Darkwing. Me and a crew of ppl, mostly teens :D, are willing to create an RPG named "Phoenix Dream". The thing is, i'm still learning, really, just starting to learn to program, so i'd need help from someone experienced enough to deal with 3D rendering and creation …

Member Avatar for zackzak
0
231
Member Avatar for Gem74

need help! need to prevent withdraw function from occuring when savings balance is below 25. The program will run, although when the balance gets below $25 it just states "account inactive" which is fine but then the menu does not display again. This is what i have so far: int …

Member Avatar for Murtan
0
217
Member Avatar for T-Dogg3030

Hi, my code prints out the number of times a letter is typed. I can get it to print out the correct info, but when it deals with a white space, it will print out the list for every white space. how can I deal with this? [CODE] #include <iostream> …

Member Avatar for T-Dogg3030
0
147

The End.