49,761 Topics

Member Avatar for
Member Avatar for deflamol

Hi, I am having issues with assigning a value to a string. I have two structures node and edge as follows: [code] struct node{ string name; int key; }; struct edge { node u; node v; int weight; edge *link; }*front = NULL; [/code] Now I have a function that …

Member Avatar for deflamol
0
107
Member Avatar for tatainti55

Is there any other way to the same thing goto does?(You know what i mean i'm just too lazy too explain it right now >.<) Goto messes everything up >. For example, let's say i made a game that displays a menu, like: "1. Play where is waldo 2.Quit" Then …

Member Avatar for tatainti55
0
94
Member Avatar for teddybouch

I am resurrecting old code from a few years ago, and I unfortunately have little documentation as to how it was compiled and what environment it was built in. At this point, I have successfully gotten it to build, but there are errors at execution, specifically an unhandled exception error …

Member Avatar for Salem
0
100
Member Avatar for T'Scoopz

Hello, I just need help converting this baby in plain old vanilla C. You can tell me the equivalents of C to C++ or whatever is more convenient for you. I'm compiling in MS Visual Studio C++ 2008 and it gives me mostly "undeclared identifiers" and "syntax errors". Thanks in …

Member Avatar for T'Scoopz
0
160
Member Avatar for cerb63

I need a little help, I'm still new to the C++ stuff and this is for my class. Any help anyone could give me would be great. the code I have is as follows: ____________________________________________________________________________ [code] #include <iostream> using namespace std; int find_fib(int); int main(int argc, char* argv[]) { int …

Member Avatar for Salem
0
214
Member Avatar for Nasi23

Hi im trying to build this pay rate calculator but im getting a few errors: [code=cplusplus] #include <iostream> #include <string> #include <iomanip> using namespace std; struct Time{ int hr, min; char meridian; }; struct Garage{ string name; float rate; Time time_in, time_out; }; struct PayRecord{ string name; string position; int …

Member Avatar for stilllearning
0
187
Member Avatar for tatainti55

I'm trying to create a text based RPG, like pokemon. At the moment i'm trying to make a store to buy health and stuff in. Everytime you kill a monster you get a random amount of money. But how do i make the program say "You can't afford that" if …

Member Avatar for tatainti55
0
171
Member Avatar for teddybouch

I just downloaded Visual C++ 2008 Express Edition and I'm trying to edit some old code for a lab that I am TAing. I took all the code and put it in a new project, since several of the old libraries will change and since I don't have them on …

Member Avatar for Sci@phy
0
767
Member Avatar for akshay144

Hi All Please help me with the following code, it works fine when i enter 1234567890 but goes mad when i enter one more digit i.e 12345678901. It keeps on looping and displays infinitely:- "Invalid Input. Please try again.!!" How can i fix/correct this? Any help will be appreciated! [code=cplusplus] …

Member Avatar for Sci@phy
0
130
Member Avatar for novice420

im trying to create a simple LAN Chat Program (as projectwork for school)....usage of filehandling is a must in all projects...since all the school computers are connected by LAN...i am creating one FILE and trying to input and read that file and display it on the screen to make it …

Member Avatar for Salem
0
198
Member Avatar for wneil22

Write a program that determines if an integer (input by the user) is odd or even. The program should also include functions that: 1) Determine if an even number is greater then 1000 2) Determine if an odd number is less then or equal to 199. The program should display …

Member Avatar for Salem
0
92
Member Avatar for andrewama

OK so I need to make a card dealing program that takes random cards from a deck and dispenses a 5 card poker hand, but i also have to right functions to tell if its a flush straight royal flush, etc... I have no Idea what to do after this. …

Member Avatar for andrewama
0
2K
Member Avatar for McCo

I am trying to create a simple animation of an envelope opening up and then closing back. I want to know if there is any way by which I can have my envelope, which is designed in MS Paint, imported onto C++ program. The envelope has dimension 932 * 590 …

Member Avatar for Alex Edwards
0
100
Member Avatar for NinjaLink

I have been stuck for awhile trying to read the data in my file. As you can see, I haven't did much coding, but I would appreciate the assistance if someone can tell me what is wrong with the code. Thanks! Example of my input file: Kay, Harry 95 A …

Member Avatar for VernonDozier
0
107
Member Avatar for JoeRoss578

I did fine on this in C, not sure what I'm doing wrong here. Probably something silly on my end. I'm receiving odd numbers in my program below. I have included the output below the program. Any assistance would be quite appreciated. Thanks! [code]#include <iostream> int main() { using namespace …

Member Avatar for sidatra79
0
202
Member Avatar for NinjaLink

My program runs fine. The only problem is at the bottom of my "[B]insertAt[/B]" function. I am trying to insert a number to the array. Whatever number I insert, it keeps appearing at the [B]front[/B] of the array instead of the position I want it to. For example: Original Array: …

Member Avatar for NinjaLink
0
373
Member Avatar for cplusplusgeek

Could there be any better ways to determine whether a number is prime or not particularly with respect to code execution. [code]#include <iostream.h> #include <conio.h> void PrimeTest(int); main() { int num; cout<<"Enter number: "; cin>>num; PrimeTest(num); getch(); } void PrimeTest(int n) { bool isPrime=true; for(short i=2;i<=(n-1);i++) { if (n%i==0) { …

Member Avatar for sidatra79
0
180
Member Avatar for Se7Olutionyg

[CODE]// file temperature table.cpp //conversion of celsius to fahrenheit temperature # include <iostream> # include <inomanip> using namespace std; int main() { const int CBEGIN = 10; const int CLIMIT = -5; const int CSTEP = 5; float fahrenheit; cout << " Celsius " << " Fahrenheit " << endl; …

Member Avatar for sidatra79
0
98
Member Avatar for jammy's

[CODE]#include<iostream.h> #include<conio.h> #include<process.h> const int max=5; class stack { int s[max]; int top; int temp; public: stack (int j,int p){top=j;temp=p;} void push(int item); void pop(); void display(); }; void stack::push(int item) { if(top<4) { top++; s[top]=item; } else { cout<<"\nStack is full!"; } } void stack::pop() { if(top>-1) { cout<<"\nThe …

Member Avatar for Denniz
0
304
Member Avatar for clutchkiller

it isnt clrscreen; cause thats not working. Can anyone refresh my memory? thanks

Member Avatar for iamthwee
0
92
Member Avatar for mrboolf

Ok, sorry to bother but it seems I don't understand this properly ^^" I have a simple class, SLListNode, as follows [CODE=C++]template <class D> class SLListNode { public: static int Count; D Data; SLListNode *Next; SLListNode(void); ~SLListNode(void); }; template <class D> int SLListNode<D>::Count = 0; template <class D> SLListNode<D>::SLListNode(void) { …

Member Avatar for mrboolf
0
81
Member Avatar for laxgrl22

PLEASE HELP!!! I dont know how to do this problem. Every time i try it keeps coming out wrong. PLEASE HELP. Thank you... An internet service provider has three different subscription package for its customer: Package A: For $9.95 per month 10 hours of access are provided. Additional hours are …

Member Avatar for Denniz
0
89
Member Avatar for elizabeth.h1

hello can someone give me a good link for downloading source code which implements improved asserts (like showing last error ,and stack trace) and generating memory dump when unhandled exception occur thank you

0
28
Member Avatar for clutchkiller

[Linker error] undefined reference to `add()' Can someone explain that a little? Do i need to include my code to help you guys explain? Thanks

Member Avatar for clutchkiller
0
65
Member Avatar for slanker70

Hi, I've seem to have a problem declaring an object within a switch statement. It keeps saying [QUOTE]error C2360: initialization of 'roll' is skipped by 'case' label[/QUOTE] My code is as below [CODE]case 2: // 25 % chance of being able to run. int roll = Random(1, 4); if( roll …

Member Avatar for Salem
0
97
Member Avatar for clutchkiller

[code] #include <iostream> #include <windows.h> using namespace std; float v1; float v2; int oper; float ans; int add() { v1 + v2 == ans; } int sub() { v1 - v2 == ans; } int mult() { v1 * v2 == ans; } int div() { v1 / v2 == …

Member Avatar for clutchkiller
0
88
Member Avatar for n8thatsme

Ok well I have 4 char arrays. Each array has predefined words in them. For example: [CODE] char *article[MAX_ARTICLES] = { "the", "a", "one", "some", "every", "any" }; [/CODE] I'm trying to make random sentences as defined by the user. So if they type in the value 567 or whatever …

Member Avatar for n8thatsme
0
166
Member Avatar for denner

the ls -ali output will be treated like a string input for the c++ program i need to write. i have tried to output ls -ali command into a txt file and below is the output of the ls -ali: -rwxr--r-- 1 User1 root 26 Nov2 19:51 Mydb.txt basically, the …

Member Avatar for stilllearning
0
664
Member Avatar for afg_91320

hey guys its me again with the rock paper scissors game. well after spending the whole day on it (ok not really) i was able to write a proper code for the game that would ask user for their input and randomly select one for the computer. now it should …

Member Avatar for chococrack
0
129
Member Avatar for mypopope

Hello I'm new to computer programming , and I'm using Dev C++ 4.9.9.2. I'm also reading C++ How To Program Pearson International Edition from DEITEL as my source of knowledge. I don't if I'm reading the right book and using the right c++ software or compiler. Hop you can give …

Member Avatar for stilllearning
0
118

The End.