49,757 Topics

Member Avatar for
Member Avatar for cplus2x

Candy Machine Simulation Write a program to simulate a candy machine.Your machine offers candy for 75 cents, gum for 50 cents, and chips for $1.You should ask the user repeatedly which of the three items she wishes to purchase, or whether she wants to quit.If she chooses to purchase an …

Member Avatar for Slate2006
0
373
Member Avatar for jenymaru08

Please help me how you will make a program that using structure with a structure ?? example please struct data { char name; int age; } how will you make your structure be in within structure ??? and please kindly explain what this mean ppre->link=ploc->link ? ? ? ?

Member Avatar for hu_is_anonymous
0
139
Member Avatar for Arctic

[code=cpp]/*I've actually located the segmentation fault location, I believe it is because I am trying to declare one array memory location equal to another when they are in seperate memory segments. However, if this is the case I have no idea on how to correct it. Here is my code …

Member Avatar for vijayan121
0
157
Member Avatar for Kupitzc

I'm in a CS class in college now, and it's in C++. I have done all the things we're covering this semester... but in Java. I'm trying to write a basic program that uses a 3d char array to store the last names of passengers in an airplane, but when …

Member Avatar for Nick Evan
0
108
Member Avatar for VersEtreOuNe

I'm making a program that is supposed to store the circles in a file, each circle should have an id and a radius. after i Add some circles to the file i need to open it again and search for a specific Id to display it. Here's what I've done …

Member Avatar for VersEtreOuNe
0
123
Member Avatar for daviddoria

Is there a way to interpolate between RGB values? I have a set of values that I want to map (linearly or otherwise) to colors from a color_min RGB triple to a color_max RGB triple. Since RGB is not "incrementable", how would I do this? Thanks, David

Member Avatar for Duoas
0
101
Member Avatar for C++masterinneed

[code=c++] bool list::remove (char * key) { char id[100]; cin.get(key, 100 ); cin.ignore(1, '\n'); //cin >> key; //remove data from the list if it exists node * prev = NULL; node * curr = headbyName; while (curr) { curr->item.getName(id); if(strcmp(key, id) == 0) { if(!prev) headbyName = curr->next; else prev->next …

Member Avatar for C++masterinneed
0
108
Member Avatar for Nyx18

what im trying to do is read in a data from a file into 4 different arrays then also read in the same data using array of structs. the assignment is to show that we know how to use both methods of reading in and sorting the data. i have …

Member Avatar for Ancient Dragon
0
80
Member Avatar for Nyx18

what i have to do is read in a maximum of 10 animals from a file (one animal per line) but if there are more than 10 animals in the file im supposed to ignore the rest and only read in the first 10. before i start to read in …

Member Avatar for twomers
0
99
Member Avatar for Metalsiege

Hey everyone.. I'm having a little problem with something I'm writing for a class.. I'm supposed to use while and a nested IF statement in the solution, but every time I run it I get the following back: [quote]Run-Time Check Failure #3 - The variable 'A' is being used without …

Member Avatar for Metalsiege
0
208
Member Avatar for nate12457

I'm getting 3 unresolved external symbol errors. I think it's probably syntax but I can't seem to find it. This is a class I was supposed to write based on the professors specifications. The header and implementation file are mine, while the driver file cannot be edited for this assignment. …

Member Avatar for nate12457
0
143
Member Avatar for FAZ3

ok I got this far in the code but I can't seem to get a person to enter an age and the program to return the info of those with the same age. I think this is what I need to use...or at least something like this on my code. …

Member Avatar for WaltP
0
85
Member Avatar for mark192

When I click on the exe file to open it up via a folder or my desktop etc... it will show a black cmd window for about half a second and then close, however if i find the directory of my exe through cmd and then run it that way, …

Member Avatar for WaltP
0
294
Member Avatar for guitarrick

Lost again...Just trying to "tie" a header file to a .cpp file, but I keep getting a 'need ;' before '{' ..... in my .cpp file at LIST::LIST() { x = 0; } Here are both files that I am fooling with: [CODE=C++] #ifndef LISTS_H #define LISTS_H #include <iostream> using …

Member Avatar for Duoas
0
117
Member Avatar for atish00

[CODE]corr[8]="pizzaboy"; error-- cannot convert char* to char corr[]="pizzaboy"; error-- char has zero values corr[0]="p" corr[1]="i" corr[2]="z" ----- syntax error corr[8]='pizzaboy' ------- char const can have 2 chars [/CODE] Is there any way to input:'( :'( :'( :'( :'(

Member Avatar for Ancient Dragon
0
459
Member Avatar for MikeKristal

I took out a lot of code, hence all of the variables you can't see, but for some reason, this part is the only one thats screwing up. When you enter zero, its supposed to "cout" a phrase that you don't have money, but when I run it, it tells …

Member Avatar for MikeKristal
0
107
Member Avatar for shadowfire36

i have done some coding back in '99 in visual basic, and i remember there a command to excutse a message box to input data . is there a similar function in C++ to excute a message box for input in a windows os ?

Member Avatar for John A
0
132
Member Avatar for andyg55

input file: 1 0 0 2 1 0 0 2 1 I would like to produce this in a 3x3 array on screen. My code: [code] #include <fstream.h> #include <stdlib.h> int i, j; int matrix[3][3]; int main () { ifstream inFile; inFile.open("input.txt"); if (!inFile) { printf ("Unable to open input …

Member Avatar for VernonDozier
0
171
Member Avatar for enrgpro

I have no background with programing, but would like to start learning. Can you recomend a good book to start with.

Member Avatar for Ancient Dragon
0
68
Member Avatar for gcardonav

Hello guys, how are all you doinbg ? Well I just created this program to cound 24 hours. The program runs fine but my only problem is when I ran the programs i get the following [inlinecode]0:0:0 4469690:0:1 4469690:0:2 [/inlinecode] Where is the number 446969 coming from ? I am …

Member Avatar for gcardonav
0
126
Member Avatar for atish00

My project is to build a hotel menu and billing program. The problem is I have to use user defined functions to do it. 1st Function [code=c++]int password(char usr_name[8], char pwd[]); { int j=0,k=0,i=0,m=0; corr[8]=pizzaboy; for(i=0;usr_name[i]!='\0';i++) { if (usr_name[i]=corr[i]) n=1; } else n=0; po[5]=qwerty; for(j=0;pwd[j]!='/0';j++) { if (pwd[j]=po[j]) m=1; else …

Member Avatar for Ancient Dragon
0
552
Member Avatar for CodeBoy101

I'm new to C++ and I'm working with the Dev-C++ complier and I'm wondering, Is there a way to change the consoe app font? I would also like to know if more than one font can be used simultaneously? thanks :)

Member Avatar for Ancient Dragon
0
88
Member Avatar for atish00

Guyz I have again got a problem with functions. [ICODE]"" Write a function to input matrices"" [/ICODE] Or how can I input using fuctions ?? is it possble ?? so far I have developed a few lines. [CODE] //fuction to input a 2D-array. int multi_array(int r , int c)//r is …

Member Avatar for atish00
0
178
Member Avatar for ShyamalShah

Ok So from many people information. I have made this programe. But i am not able to use input operater overloading. So please help me in this. An also tell me how to make this programme simple. Once again thanks a lot to push me to do my homework on …

Member Avatar for gerard4143
0
89
Member Avatar for johnRiley

Hi all, I've been searching for hours but i can't find any solutions so i hope someone can help... Is there any way of proving that the += operator is more efficient than the + operator... i.e. A += B instead of A = A + B I'm hoping to …

Member Avatar for vijayan121
0
130
Member Avatar for vishalkhialani

I have learned the basics of c++ and found out that different c++ compilers behave differently especially when it comes to errors. I would like the community to advice as to which compiler is the most popular and if it can be used with .net so that once I develop …

Member Avatar for vijayan121
1
173
Member Avatar for jov0708

i wrote a code to get hard disk info and used FindFirstVolume(). however, the console-based application was ok but when i made an MFC application doing the same thing, it did not compile correctly. i think the problem is with my redeclaration of _WIN32_WINNT in the MFC application. this is …

Member Avatar for jov0708
0
495
Member Avatar for linux0id

Hello everyone! I am new to C++. I am learning GUI programming using gtkmm on linux. I have a frame class, and I have a library class (that writes data to sqlite) that belongs to that frame. How should I declare it - by pointer or reference? like - [CODE]class …

Member Avatar for linux0id
0
88
Member Avatar for Darko

hey all :cool: !! me a new member here.. jsu joined up a couple of weeks back.. anyways peeps me is in fy B.E .CSE .. tho i am not a good programmer i dunno y i took it up... but i still like it... :D as all do i …

Member Avatar for jkertel
0
158
Member Avatar for boyet1970

hey guys im new here can anyone teach how to start.(cus i want to learn c++ programming how will i start).

Member Avatar for TimeFractal
0
107

The End.