49,767 Topics

Member Avatar for
Member Avatar for Lutzee

Hi there, im a c++ noobie. I have a class called node. Node has a data member id. When i try and access id in the obect named f outside of main visual studio 2003 gives me the errors: : error C2065: 'f' : undeclared identifier error C2228: left of …

Member Avatar for Salem
0
123
Member Avatar for pitopito

Hi, My goal is to perform a single SQL query (“select xxx from yyyy etc etc”) to a Database over a LAN, using BORLAND C++ 4.5 and managing USERNAME and PASSWORD. I tried 2 methods so far : Method N.1) I used “Tquery”, TdataSource and TDBedit components linked togheter and …

Member Avatar for Ancient Dragon
0
111
Member Avatar for FireSBurnsmuP

Alright, I cannot get the getline function to work. I have iostream included, using namespace std, and here is the syntax I have down: [inlinecode]cin.getline(playerOne, 21);[/inlinecode] with playerOne declared previously as a string, and I want its max input to be 20 characters. What's going on here? It's not working …

Member Avatar for WolfPack
0
153
Member Avatar for matt611

Ok our teacher gave us a .h and .cpp file for a class called "JarType" and our assignment is to overload some of the math operators. Now I know how to overload operators if I'm adding two JarTypes together. What I'm having a problem with is overloading when I have …

Member Avatar for WolfPack
0
110
Member Avatar for LieAfterLie

How would you change the same member of many objects of the same class (or structure if possible)? [CODE]struct point { float x, y, z; } point a, b, c; a.x += 20; // b.x += 20; // now how would i do this in one statement? c.x += 20; …

Member Avatar for LieAfterLie
0
80
Member Avatar for Barefootsanders

Hey guys. Ive been working with fstream for about 2 hours and i give up. My problem is I have a text file with an unknown number of rows. Each row has a known number of items. i cant figure out how to read the elements in each row. after …

Member Avatar for Barefootsanders
0
73
Member Avatar for aznballerlee

I just got my C++ assignment today, and I don't understand it. Here are the instructions. The topic is on DDR (Dance Dance Revolution) [B]Your task[/B] For this project, you will implement the following two functions, using the exact function names, parameters types, and return types shown in this specification. …

Member Avatar for Ancient Dragon
0
71
Member Avatar for ReDeViL

Write a program that accepts a number and produces a pattern as shown in the following sample outputs. Line = 3 *.* .* * Line = 8 .*.*.*.* *.*.*.* .*.*.* *.*.* .*.* *.* .* i've just learnt to use the setw() command..... but how do you fill up the alternate …

Member Avatar for ReDeViL
0
137
Member Avatar for taruj83

hi, i need to write a c++ program that takes input of a expression like say y = 5 + 2b; and gives out the output y = 5 + 2b it uses linked lists and the expression can be composed of integers, variables and operators. the encoding of tokens …

Member Avatar for iamthwee
0
98
Member Avatar for nono909

Hello, i'm trying to write in the main program a linked list of namesfractions, and integres. i don't know if anyone can help me in this. i attached the fraction class and the implementationUsing the linked list class we derived in class, and the following functionality:[LIST] [*]A print function (you …

Member Avatar for iamthwee
0
86
Member Avatar for Eadams20

[code] #include <cmath> #include <iostream> using namespace std; //Function prototypes void getPrice (float&); void getInterestRate (float&, float&, float&); void getDownPayment ( float&); void gettradeIn (float&); void calcmonPayment (float, float, float, float, float, float&); int main() { // Input variables float price; float downPayment; float tradeIn; float loanAmt; float annualIntRate; float …

Member Avatar for Nick Evan
0
103
Member Avatar for easy

im just doing a little exercise on the bubble sort algorithim, i included two ways of incresing its speed. 1. Breaking out of the loop if no swaps are made 2. Decreasing the inner loops lenght each pass I think there is two ways of doing it. This way i …

Member Avatar for WaltP
0
86
Member Avatar for disc

Hello, Can anyone tell me what the code beneath means. I've searched but can't find a clear explanation. Maybe someone can give an example of how to use it. Thanks... [code] [COLOR=#0000ff]bool[/COLOR][COLOR=#000000] MyClass::[/COLOR][COLOR=#0000ff]operator[/COLOR][COLOR=#000000]()()[/COLOR] [COLOR=#000000]{ [/COLOR] [COLOR=#000000] ....[/COLOR] [COLOR=#000000]}[/COLOR] [COLOR=#000000]class MyClass[/COLOR] [COLOR=#000000]{[/COLOR] [COLOR=#0000ff]virtual[/COLOR] [COLOR=#0000ff]bool[/COLOR] [COLOR=#0000ff]operator[/COLOR]()(); } [/code]

Member Avatar for disc
0
165
Member Avatar for taruj83

dont know what is wrong with this, wont give me the result. please help [code]#include <iostream.h> #include<stdlib.h> #include <process.h> #include <conio.h> class SortList { private : int *list; int size; public : SortList(int size) { list=new int[size]; this->size=size; } void Swap(int i,int j) { int tmp; tmp=list[i]; list[i]=list[j]; list[j]=tmp; } …

Member Avatar for WolfPack
0
108
Member Avatar for GarveyDesign

I've just bought a copy of Borland C++ V.6 personal, for the purposes of compiling/'single stepping' my C code for college work. When I click the right pointing green arrow, the code compiles, (HelloWorld!) but trying to single step through the code or get an executable isn't obvious. Trying to …

Member Avatar for GarveyDesign
0
97
Member Avatar for rgbivens

Hi guys, I just found this site while doing a google search for "declaration syntax errors" and it looks like there are some great people here that are willing to take time to explain things which is what I need! I'm in college taking c++ and my teacher doesn't tell …

Member Avatar for WolfPack
0
223
Member Avatar for AnG'

[COLOR=#555555]Greetings C++ Lovers:[/COLOR] [COLOR=#555555]I'm a student very new to this C++. Yes I took Linux & UNIX. That was a year ago and I've never applied it to ANYTHING. If it's not too much trouble, I'm at a loss. A Big LOSS. You see, the reason I say this is …

Member Avatar for AnG'
0
125
Member Avatar for doraemon

I recently learned the command-line argument from my book, and I understand that both of argc and argv. HOWEVER, I don't know when I will use them and for what purpose??? I appreciate if anybody can help me!!:sad:

Member Avatar for doraemon
0
216
Member Avatar for jhdobbins

As far as i thought, this should work?? there is a spot or 2 i am concerned if i did it right though. Any ideas would be nice. It fatally crashes when ran in windows, didnt try in linux due to the fact i know it wouldnt work there either …

Member Avatar for ~s.o.s~
0
157
Member Avatar for khem Nath

a)how to run c++ program on Borland c package.I am preparing a graphic program on c++ but my progrm shows it can't run on windows. b)how a pointer is un limited array.:)

Member Avatar for Ancient Dragon
0
71
Member Avatar for stupidenator

Hello everyone, I am working on an assignment which has me build a huffman tree. I am fairly confident that I have built my huffman tree correctly, but now I must get the Huffman code for the characters being encoded (I need to get the 1's and 0's). I am …

Member Avatar for iamthwee
0
1K
Member Avatar for boule

Hi guys, I need to find the size of the activation record of a procedure using the "address of" (&) operator... Any idea how it's done ?? Thanks for your help Boule

Member Avatar for Salem
0
159
Member Avatar for nick937

I wrote two programs, this one: [code] #include<iostream> using namespace std; main() { char rom,invalid; double tot; tot=0; cout<<"Please enter Roman numerals ending with a period."<<endl; while (rom != '.') { cin.get(rom); if(rom=='M' || rom=='m') { tot=tot+1000; } else if(rom=='D' || rom=='D') { tot=tot+500; } else if(rom=='C' || rom=='C') { …

Member Avatar for ~s.o.s~
0
106
Member Avatar for rhhaney145

Please Help, I am trying to create a visualizer for STEP (standard for exchange of product model data) files using C++ and OpenGL on Windows XP platform. I can get the OpenGL to draw some simple lines/shapes, the problem seems to be with parsing/understanding the file protocol. Has anybody out …

0
82
Member Avatar for Mangai

Hi, I am Mangai, I am working in VC++. When I run my code I get an error like error C2143: syntax error : missing ';' before '*' error C2501: missing storage-class or type specifiers since I am a beginner I couldnt fix it. Can anyone help me in fixing …

Member Avatar for Mangai
0
221
Member Avatar for matrimforever

How do I call a function outside of main or use a parameter to pass a reference? If my function is: [code] void getData(int& diameter, int& price) { cout << "Enter in the diameter of the pizza in: " << endl; cin >> diameter; cout << "Enter in the the …

Member Avatar for matrimforever
0
128
Member Avatar for venomlash

I use Bloodshed Dev-C++ version 4.9.9.2 and it is a little weird in that it accepts "and" as "&&" and "or" as "||", not to mention not requiring parentheses around separate clauses in and/or connected statements. Therefore it would read the following as the same. if(voice==loud or voice==annoying and voice==whiny){ …

Member Avatar for vegaseat
0
201
Member Avatar for nimmi

:?: converting binary numbers entered by the user to their equivalent decimal,program will have one function that takes an integer(1 and 0) upto 10 digits in length.Means binary into decimal ,I dont know where iam doing mistake, and my out put if i entered binary no 111 or any bin …

Member Avatar for Infarction
0
124
Member Avatar for FireSBurnsmuP

I'm trying to write a destructor function for my class type message, but I can't get the dang thing to [inlinecode]delete[/inlinecode] strings. So, uhm, Help! Do I have to go through a for loop and delete each character individually?

Member Avatar for ~s.o.s~
0
115
Member Avatar for matrimforever

Hi, I need to write a n00b program that calculates the best deal customers can get when buying pizza. The premise is, although an extra large pizza may appear a better buy, you need to calculate the cost per sq inch of both round and rectangular pizzas to really know. …

Member Avatar for ~s.o.s~
0
2K

The End.