49,761 Topics

Member Avatar for
Member Avatar for Nastadon

Alright I'm currently in a C++ class and we just got to switch statements, and I can't get them to work for the life of me. I've googled my issue and my code seems to be exactly right, but no matter what my code doesn't work correctly, so I guess …

Member Avatar for Taywin
0
203
Member Avatar for coolbeanbob

Hello Everyone, I am trying to implement an overloaded < operator. I found the code below at [url]http://www.java2s.com/Tutorial/Cpp/0200__Operator-Overloading/Theoverloadedlessthanoperatorswithdoublevalue.htm[/url] I am trying to use this as a tutorial, but I don't understand what is happening on line 23-24. I am also a little fuzzy on line 9. Why can't it be …

Member Avatar for NathanOliver
0
185
Member Avatar for dashure

[CODE] class CRealEstate { public: // constructor CRealEstate(int num_of_rooms , const string & address)throw(string*) { try { m_num_of_rooms=num_of_rooms; if(address=="\n") throw "Wronge Address..\n"; m_address=address; } catch(const char *str) { cout<<str<<endl; } } virtual void Print()const =0; virtual unsigned Profit()const =0; friend ostream& operator<<(ostream& os , const CRealEstate &p) { p.Print(); return …

Member Avatar for Taywin
0
98
Member Avatar for valestrom

Hi, I got the error C2064: term does not evaluate to a function taking 2 arguments The error is in line 76, help would be great. Here is my code: [CODE]#pragma once namespace ValestromsCalculator { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; …

Member Avatar for valestrom
0
474
Member Avatar for NoUserNameHere

This topic is really hard for me to grasp. I tried making a program to test out operator overloading and I can't seem to get it to work. [CODE]#ifndef TESTCLASS #define TESTCLASS using namespace std; class testClass { public: testClass(double, double); friend testClass operator+(testClass& a, testClass& b); private: double num1, …

Member Avatar for NoUserNameHere
0
142
Member Avatar for anonadre

I'm having trouble with the 3rd if statement of my code if(select == 3). Here, if the user selects '3', then they should be able to search for students (given that students have already been inputted), via their ID. The ID that is searched and the subsequent Name relating to …

Member Avatar for anonadre
0
125
Member Avatar for vergil1983

I'm trying to make a function to insert a few integers into a sorted vector and display the integers in decreasing order. Actually is from my college tutorial question. Not that i don't want to ask my lecturer but i'm trying to learn myself how to solve the problem and …

Member Avatar for Narue
0
274
Member Avatar for infantheartlyje

Hi all, I'm doing a software. In this i want to develop my report engine in c++ using linux platform. Now my report engine should connect with my browser (Display engine). How i connect C++ with browser?? Example : in my report engine there 'll be class like below. Class …

0
99
Member Avatar for alle

I am using Visual C++ 2010 Express (that doesn't have MFC). Despite that, I have been able to create a Dialog box and populate the fields (and hopefully, soon, read back some data). I now want to use some radio buttons. To that end I have created two buttons with …

Member Avatar for NicAx64
0
173
Member Avatar for coolbeanbob

Hello, It seems like every time I start a new project with classes I have trouble with this. I am getting an error "undefined reference to 'Item::Item()' I'm sure I am overlooking a simple mistake. I have been looking at this for an hour and I cannot seem to find …

Member Avatar for raptr_dflo
0
97
Member Avatar for TheNNS

In my c++ class we are assigned to make a piglatin translator. I haven't had much experience with c++, but I've done quite a bit of programming in other languages. My main question would be what functions are available in c++ to handle strings and change them? I have a …

Member Avatar for gerard4143
0
133
Member Avatar for fsefsef23

I have to use a function to reverse print a doubly linked list of 'items'. My teacher provided me with the implementation prototype to use, which looks like this [CODE]template <class itemType> void List<itemType>::reversePrint(ostream &output) const[/CODE] The only details he had written was "reversePrint is passed the stream to print …

Member Avatar for NathanOliver
0
110
Member Avatar for garu525

Hello, what's the best way to sort a string to ints & chars. For example: "John Doe M 36" to John Doe (char[]) M (char) 36 (int) I researched about istreamstring sin(), but I'm not yet fully familiar with it, any tips. Thanks!

Member Avatar for Duoas
0
180
Member Avatar for owenransen

I thought I knew this but I don't. Currently I use RegCreateKeyEx to create a key, and then I call RegSetValueEx. Now what happens is that I create another key (folder in the regedit GUI), and I set the default value for that key (folder). But how do I add …

Member Avatar for mcriscolo
0
468
Member Avatar for neptali

I've use to create this in Turboc++ 3.0 and there are four linker error how could i fix this? [CODE]#include<stdio.h> #include<graphics.h> #include<conio.h> main() { int gd=DETECT,gm,col=0; initgraph(&gd,&gm,"c:\tc\bgi"); while(!kbhit()) { setcolor(15); circle(col,100,50); col++; if(col>=600) col=0; cleardevice(); } }[/CODE]

Member Avatar for thekashyap
0
164
Member Avatar for bearlow

I'm trying to store these arrays into the matrix [CODE]double X[5][3][/CODE] so I could classify them with 1 Nearest Neighbour: [CODE=C]double brick_v[3]={ent_brick,en_brick,con_brick}; double metal_v[3]={ent_metal,en_metal,con_metal}; double skin_v[3]={ent_skin,en_skin,con_skin}; double wood_v[3]={ent_wood,en_wood,con_wood}; double grass_v[3]={ent_grass,en_grass,con_grass};[/CODE] I would be very grateful if someone would show me how you can do this in C++.

Member Avatar for Fbody
0
205
Member Avatar for XodoX

Let's say I have a string with 1+5*9+4 etc.. whatever it may be. How do I use C++ do calculate this? I know recursive functions work here, but how? I figured I could loop ..searching for the * first ( higher precedence ) and then the +. No idea. Would …

Member Avatar for Taywin
0
162
Member Avatar for monstro

In Windows, events are kernel objects. I am thinking that because of this, they should be accessible across processes, given each process has security access and the name of the handle. Another engineer argued with me that they are used only within processes...but I believe he is wrong. Anyone know …

Member Avatar for mritpath
0
360
Member Avatar for sujan.dasmahapa

Dear Friends I am wirting an application for drawing a rectangle on the screen using opengl and mfc. So I implemented the OnPaint function, OnDraw function is also giving the same problem. It's drawing fine. I want to implement pan, zoom, and rotate functionalities. Now everytime the mouse moves I …

0
82
Member Avatar for imcgrath1

Hi I come from Python background and learning C++. In one of my programs, I need to have one key with multiple values and both being strings. for e.g. [CODE] "str1" ---> "value of str1" "str2" ---> "value of str2" "str1" ---> "value of str1 1" "str1" ---> "value of …

Member Avatar for mike_2000_17
0
3K
Member Avatar for tyu1996

Hello everyone. I am a new C++ learner and I have a question, is there only a constant C++ syntax in the world or there are many different types of C++? Because last month when I surf internet to see somebody made his own C++ program, I saw it his …

Member Avatar for cse.avinash
0
191
Member Avatar for bennetk2

Assignment You are to write a program that will convert any base 10 number a to any base b. Input two values, the first in base 10 and the second value is the base that is to be converted into. Bases only between 2 and 9, and flag invalid input. …

Member Avatar for bennetk2
0
2K
Member Avatar for falconmick

I know that this is probably a stupid question :\ but I am stupid... I am getting [ICODE]1>angledCollision.obj : error LNK2001: unresolved external symbol "protected: static class angledCollision * Singleton<class angledCollision>::ms_Singleton" (?ms_Singleton@?$Singleton@VangledCollision@@@@1PAVangledCollision@@A) [/ICODE] [ICODE]1>spawningArea.obj : error LNK2001: unresolved external symbol "protected: static class angledCollision * Singleton<class angledCollision>::ms_Singleton" (?ms_Singleton@?$Singleton@VangledCollision@@@@1PAVangledCollision@@A) [/ICODE] I …

Member Avatar for falconmick
0
528
Member Avatar for falconmick

I promice everone that I have looked and looked and looked for a solution, I'm not just having a problem and being lazy putting it on daniweb... haha :) ull have to trust me, ive even googled it :O! Ok, so I am wondering, if I wanted to return a …

Member Avatar for falconmick
0
239
Member Avatar for iamthesgt

In writing a logger for an application, the datestamp ends up adding a new line. The datestamp function is as follows: [CODE]string log_class::get_time() { time_t rawtime; time (&rawtime); string timestamp; timestamp = (ctime (&rawtime)); return timestamp; } [/CODE] This outputs something like [ICODE]Tue Sep 6 14:58:35 2011[/ICODE], but when called …

Member Avatar for NathanOliver
0
772
Member Avatar for valestrom

Hopefully my last question for awhile, I wrote a piece of code like this before, but now I get the error: error C2064: term does not evaluate to a function taking 2 arguments Here is my code: [CODE]#pragma once namespace ValestromsCalculator { using namespace System; using namespace System::ComponentModel; using namespace …

Member Avatar for valestrom
0
201
Member Avatar for DrShroom

I am having some issues with my project. This is homework and I am not looking for answers, just some help. I am to create a RationalNumber class that takes two rational numbers (fractions), reduces them, and I am then supposed to use overloaded operators to add, subtract, multiply, and …

Member Avatar for DrShroom
0
282
Member Avatar for addision

Please help. I have an assignment for a class and I have been working on this for a week. Nearly all of it I finished in two days but I have been stuck with this problem for 5 days now. I am using MS VC++. I am having quite a …

Member Avatar for Greywolf333
0
261
Member Avatar for jlharri9

I am an absolute newbie to C++. I have an ATM program problem where I need to keep a running total of transactions and the balance of the checking account. I cannot think of how to set an accumulator for the transactions or how to keep a running total of …

Member Avatar for raptr_dflo
0
193
Member Avatar for Deepo

hey guys so I'm studying a unit called Object Oriented Analysis its not one of my strongest units so i need some help in the concept of understanding UML and i have a exam coming up and i was if you guys could help me understand the basic concepts here …

Member Avatar for fruitymo
0
155

The End.