49,767 Topics

Member Avatar for
Member Avatar for Dontais

When I compile the program it returns "error C2065: 'answer' : undeclared identifier". I thought answer was declared from the function and would call answer. Any tips where I'm going wrong on this. The program is made to out put Radius, cosx(x), and a user defined cosx in 3 rows. …

Member Avatar for Dontais
0
107
Member Avatar for Lrddpy

Hi So I've been developing this game for a game design class for most of the semester. While I'm not new to C++ and Object Oriented Design, the theory of it is often a lot easier to comprehend and know than the actual application of it. Needless to say, I've …

Member Avatar for Lrddpy
0
230
Member Avatar for Trader09

For future reference here are the instructions for my assignment. Thank you in advance for any feedback you can provide: Implement the Message class using a header and implementation file named Message.h and Message.cpp respectively. In addition to the two Message class files, you must write a driver. The driver …

Member Avatar for Trader09
0
216
Member Avatar for khatib009

I am having a serious problem with a assignment i must do, this is the final assignment and the person that used to help me is not helping me anymore, i need to recieve a good grade on this assignment, and i dont know how i can because i dont …

Member Avatar for Ancient Dragon
0
110
Member Avatar for Samisam80

Write a program that will do the following: 1. Define a function that will read from a file text paragraph convert the whole paragraph into capital letters and print it on the screen after conversion. 2. Define a function that will count and return number of vowels in the above …

Member Avatar for Ancient Dragon
0
101
Member Avatar for cubathy

Hi everyone. Getting compile errors with the following code that i can not figure out...: [code] template <class T> class X{ class Y{ public: Y(); }; X(); }; template <class T> typename X<T>::Y * operator[](X<T> * obj1, int index); [/code] The compile error from mingw is: [code] test.h:18: error: 'typename …

Member Avatar for cubathy
0
109
Member Avatar for f.ben.isaac

To make things easier for cosing in Win32 API, MFC is created which wraps Win32 API in classes. At the beginning i though MFC is there only to aid you making C/C++ GUI Application. For example, CSocket() wraps the function socket(), printf() gets wrapped in another class, and so on. …

Member Avatar for f.ben.isaac
0
243
Member Avatar for chchiu
Member Avatar for mrboolf
0
127
Member Avatar for Shinedevil

I need to find out, because my program deals with numbers, how to block characters from being inputted. Such as, [code] int input; cout<<"Please type in a number."<<endl; cin>>input; //input should be a number. A letter? Oh no. [/code] if the input would have been a character, BOOM! Program == …

Member Avatar for StuXYZ
0
200
Member Avatar for abhijitm

Hi In the below code , i am getting compile time error when declaring the copy constructor . C:\work\Dev-Cpp\bin>"mingw32-c++.exe" dynamicArray.cpp dynamicArray.cpp:13: error: expected `,' or `...' before '&' token dynamicArray.cpp:13: error: ISO C++ forbids declaration of `dynarrray' with no t ype dynamicArray.cpp:13: error: `dynarray::dynarray(int)' and `dynarray::dynarray(in t)' cannot be overloaded …

Member Avatar for abhijitm
0
147
Member Avatar for sid78669

I have a very similar issue. I am also doing and assignment and needed a function grow. This was to increase the size of the object array Savings by s, if it was not NULL, or make its size s if it was null. In both the case it was …

Member Avatar for ArkM
0
142
Member Avatar for koushal.vv

Hi All, i have a problem in converting CString to Int/Double, function i am using is _wtoi , _wtof..... Here if the CSting value has say "12345" this works perfectly. But if any other value is say ( Over flow ) " 11111111111111111111111111111" which exceeds the max size of int …

Member Avatar for koushal.vv
0
234
Member Avatar for littlestone

Does it need a copy constructor and an operator= for a class which have array member? for example: Class A { private: B data_[100]; //B is a class }; does class A need a copy constructor and an operator? in other words, is the default copy constructor is OK for …

Member Avatar for abhijitm
0
212
Member Avatar for drjay1627

I have string and a map<string,int> i need to iterate through the map and find string[i] and replace the int with the string. eg: if map contains hello 6 world 4 its 3 me 60 if the string is "its me hello world world hello" output should be "3 60 …

Member Avatar for ArkM
0
128
Member Avatar for AutoC

I have a c++ program that performs a functionality. generate.h [code] struct code { bool out; bool *reg; }; class Cyclic { private: struct code *cy; int rgsize; bool *gen; int gensize; unsigned short cycodes[256]; public: Cyclic(int a, int b,bool c[]); void leftShift(); bool* cyclicCode(bool mssg[],int msize); void printReg(); bool* …

Member Avatar for ArkM
0
227
Member Avatar for xinix

Hey all, I posted a question earlier this week regarding dev-c++ and my inability to keep the output window (#include <iostream>) open long enough to see my program running! I have already tried the following things and would be grateful for any other suggestions! 1: (Without typing using namespace std;) …

Member Avatar for VernonDozier
0
2K
Member Avatar for abhishek.com

Hi Guys I have a query regarding "sizeof" operator and it is related to the program: [B][COLOR="Red"]{ int x; x=sizeof (-32768); printf("%d",X); getch(); }[/COLOR][/B] Then it's printing it's value as [COLOR="Red"]4[/COLOR], But logically it should be[COLOR="Green"] 2[/COLOR] because the integer range is from -32768 to 32767. ============================================== [B]And my second …

Member Avatar for vmanes
0
119
Member Avatar for solimanmuttawa

this is a linked list assigment and the required from me is to fill the functions: i have one fucntion left that i was unable to do which is void DeleteElement(int ID); and i have another problem the compiler states that i hve o errors but when i compile the …

Member Avatar for Lerner
0
89
Member Avatar for bombe

Hi viewers, I was trying to delete a file from my hard drive and I don't really have a good place to start. I googled it and came up with a code derived from multiple sources. I was wondering if anyone could help me out with the code to delete …

Member Avatar for permoda
0
120
Member Avatar for robgeek

I am trying to read a file from fstream in a switch statement but something in the code seems to be stopping this part of my code to be read by the compiler. Please some one let me know what am I doing wrong. Its not the text file thats …

Member Avatar for robgeek
0
302
Member Avatar for preet4fun

i nees to make a function to output students name in the form last name followed by a comma followed by a space followed by the first name and the name must be left justified than next to it need to print the student score and student grade like this: …

Member Avatar for Lerner
0
86
Member Avatar for jimbob90

[code=c++] 4 char *min(char *a, char *b, char *c){ 5 if(strcmp(a,b) > 0) && (strcmp(a,c) > 0) 6 return a; 7 else if(strcmp(b,a) > 0) && (strcmp(b,c) > 0) 8 return b; 9 else 10 return c; 11 } [/code] Code won't compile and the irony is i just did …

Member Avatar for ArkM
0
3K
Member Avatar for valluvanl

Is it possible to call a void function from another void function? will this work? [code] mainMenu() { int input; cout<<"\t\t Main Menu \n\n"; cout<<"\t\t 1. Student Details \n"; cout<<"\t\t 2. Payment Details \n"; cout<<"\t\t 3.Exit \n\n"; cout<<"\t\t Select 1/2/3 : "; cin>>input; if(input==1) { void studentDetails(); } if(input==2) { …

Member Avatar for valluvanl
0
121
Member Avatar for Jason123

I have classes with inheritance (for now only Car, more to add on like Bus, Truck etc) and adding to list. 1) How can i display using the subclass display function? 2) Can list<Vehicle> list be in a class? [code=cpp] #include <iostream> #include <list> using namespace std; class Vehicle { …

Member Avatar for ArkM
0
90
Member Avatar for MosaicFuneral

Here's what I'm trying out: [icode]Substitute characters into values with no set left bits; check if the next position is a vowel(or whatever), turn it into a value with no right bits set, join the two characters into a single byte, delete the unused position now.[/icode] Here's the code using …

Member Avatar for MosaicFuneral
0
293
Member Avatar for Majestics

[code] Apply all steps of conceptual and logical database design on the following requirements: The system should be able to store a customer’s name, address, and contact information and a book’s ISBN, publisher, authors, and title information. A customer should be able to purchase one or many books at a …

Member Avatar for Majestics
0
105
Member Avatar for rumencho

Hi all. When I create simple console application with Visual Studio C++ ,and I run it, my program shows on full screen, How to adjust my .exe files to show on single console window?

Member Avatar for ArkM
0
94
Member Avatar for rtmarch

so i have been sitting here for about 2 days finishing this thing and i still have one error left and i am having a hard time fixing it 1>k:\c++\energy bill part 3\energy part 2.cpp(119) : error C2059: syntax error : ';' here is my code thanks for your help …

Member Avatar for TheBeast32
0
123
Member Avatar for AcidG3rm5

Hi all. I was writing my program. And halfway through, i tried to compile and run. but got a blank output. I tried doing a cout<<"hello"<<endl at the main() must still didn't get any display. could anyone please help me to see what went wrong? [code=cplusplus] #include <iostream> #include <fstream> …

Member Avatar for Ancient Dragon
-1
122
Member Avatar for knharp3

[code] #include <iostream> #include <cmath> using namespace std; int main () { float leg1, leg2, hyp; cout << "Enter one leg "; cin >> leg1; cout << "Enter one leg "; cin >> leg2; if ((leg1 < 0) || (leg2 < 0)) hyp = 0; else hyp = (sqrt((float)leg1*leg1 + …

Member Avatar for ArkM
0
139

The End.