Posts
 
Reputation
Joined
Last Seen
Ranked #4K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
90% Quality Score
Upvotes Received
8
Posts with Upvotes
6
Upvoting Members
7
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
4 Commented Posts
3 Endorsements
Ranked #486
Ranked #1K
~7K People Reached
Favorite Forums
Favorite Tags
c++ x 63

35 Posted Topics

Member Avatar for BeyondTheEye

For an electronics project, I have to access the TxD, RTS and CTS pins of a serial port individually. Well, any 3 pins could be used, but those 3 are preferred. All I've been able to find on the microsoft website are functions to access the serial port as a …

Member Avatar for BeyondTheEye
0
264
Member Avatar for dinamit875

Change line 55 from [icode]cin >> newTeam, sizeof(newTeam), stdin;[/icode] to [icode]cin >> newteam;[/icode] Line 74 still has the same problem. You fixed your cout statement on the line above, but not the cin line. I'd follow jonsca's advice and read up on cin/cout.. Well, short version: [CODE=CPP]int a, b; cin …

Member Avatar for dinamit875
0
291
Member Avatar for BeyondTheEye

[I]Assignment:[/I] Write a function zet_om_naar_getal(getal) that calculates the binary representation from a decimal number as a string, using recursion. [I]What I have so far:[/I] [CODE=CPLUSPLUS]string zet_om_naar_binair(double getal) { string binair; if(getal >= 1) { binair += '0' + static_cast<int>(getal)%2; binair += zet_om_naar_binair(getal/2); } else if(getal > 0) { double dubbel …

Member Avatar for thines01
0
120
Member Avatar for cproud21

From what I can see the error is in your stack/queue declaration. You're adding charachters, not strings.[CODE=CPP]queue<char> aQueue; stack<char> aStack; //instead of queue <string> aQueue; stack <string> aStack; [/CODE]

Member Avatar for BeyondTheEye
0
121
Member Avatar for Muathelbou

FirstPerson's code works, but it's bad coding practice to hard code the ASCII numbers. Also stated in your assignment, if you are to use character literals you just have to change the numbers to letters. [CODE=CPP] bool isLowerCase(char ch){ //Check if the letter is between a to z return ( …

Member Avatar for tintin.iitk
0
226
Member Avatar for alexa868

[CODE=cpp] bool quit = false; while(!quit) //And some other conditions, obviously { //Do something if(break) quit = true; //Break out of the loop by failing the condition for the loop, without using break } [/CODE]

Member Avatar for BeyondTheEye
0
98
Member Avatar for restrictment

You missed the point in references. When a variable is passed to a function, a copy is made, so you can't change the original. When a pointer, or an array, is passed you CAN change the value, it just tells the function where to find the original. To be able …

Member Avatar for restrictment
0
374
Member Avatar for guguman

From what I can tell from the error your account class has no default constructor. When you declare a constructor for a class, the compiler expects you to supply all constructors, including the default constructor. checkingaccount inherits from account, which means it will first contruct an account object and then …

Member Avatar for SVR
0
140
Member Avatar for xxunknown321

I guess you're not familiar with this forum, so I'll just refer you [URL="http://www.daniweb.com/forums/announcement8-2.html"]here[/URL].

Member Avatar for xxunknown321
0
187
Member Avatar for ured

[QUOTE=ured;1033939]Thanks FIRSTPERSON....but how do I copy from the string starting at stringIndx to its size?[/QUOTE] Use substr from the string library. If you want it as an int you can use atoi from there. [CODE=CPP]string number = S.substr(stringIndx); //Copies from stringIndx to end into number int num = atoi(number.c_str()); //Get …

Member Avatar for jonsca
0
107
Member Avatar for apo

An ofstream is an object, not a function. To open a file using ofstreams you first create the object, then open the file. Like so: [CODE=CPP]ofstream file; file.open("a.txt"); //Do something file.close();[/CODE] In your case you could place it in a loop. You'll have to make a string object to get …

Member Avatar for niXman
-1
185
Member Avatar for UKmason

Function calls always require paranthesies(), even if there are no parameters. In your case you'd have to do something like: [CODE=CPP]int celcius, farenheit; cel_to_far(celcius, farenheit); cout << "When you have " << celsius << " degrees, that is equal to " << farenheit << " degrees, Fahrenheit" << endl; cout …

Member Avatar for BeyondTheEye
0
440
Member Avatar for tomtetlaw

Havn't tested this, so there might be a few errors: [CODE=CPP]void split_string(const string& src, vector<string>& dst, char split) { int startPos = 0, endPos = src.find(split); while(endPos != string::npos) { dst.push_back(src.substr(startPos, endPos-startPos)); startPos = endPos + 1; endPos = src.find(split, startPos); } }[/CODE]

Member Avatar for sfuo
0
102
Member Avatar for killerqb

You should either include "hashTable.cpp", or have the class declaration and implementation in the same file(as firstPerson already pointed out)

Member Avatar for mrnutty
0
145
Member Avatar for lipun4u

You might want to change your destructor. [CODE=CPP]delete [] st;[/CODE] instead of [CODE=CPP] delete st; [/CODE] You'll be creating memory leaks if you don't.

Member Avatar for mrnutty
0
135
Member Avatar for scantraXx-

I'd switch the order of printing around. First print a comma, then print the number. This does require you to find the first number beforehand, though. [CODE=CPLUSPLUS]void set::Display() const { cout << '{'; int i = 0; while(i < setlist.size() && setlist.at(i) != true) i++; if(i != setlist.size()) cout << …

Member Avatar for Poincarre
0
158
Member Avatar for BeyondTheEye

I've created a class, Category. [CODE=cpp]#ifndef CATEGORY_H_INCLUDED #define CATEGORY_H_INCLUDED #include <string> using std::string; enum Type {Integer, Double, Bool, String, Date, Time}; class Category { public: Category() : itsType(String) {} Category(Type type) : itsType(type) {} Category(string name) : itsName(name) {} Category(Type type, string name) : itsName(name), itsType(type) {} ~Category() {} void …

Member Avatar for mrnutty
0
97
Member Avatar for BeyondTheEye

I'm having trouble getting the right operator to be accessed using polymorphism. The code below is a simple representation of the problem, but it should get the point across. [CODE=CPLUSPLUS]//Horse.h #ifndef HORSE_H_INCLUDED #define HORSE_H_INCLUDED #include <iostream> #include <string> class Horse { public: Horse() {} Horse(int age) : itsAge(age) {} virtual …

Member Avatar for BeyondTheEye
0
125
Member Avatar for scizj

[code=cpp] class complex { friend ostream& operator<<(ostream& output, const complex& V); private: double REAL; double IMG; public: complex(); ~complex(); //Added functions double GetReal() const {return REAL;} double GetImg() const {return IMG;} }; //IMPLEMENTATION of <<: ostream& operator<<(ostream& output, const complex& V) { output<<"("<<V.GetReal()<< "," << V.GetImg()<<")"; return output; // for …

Member Avatar for scizj
0
119
Member Avatar for Manutebecker

I'm guessing you're looking for something like this. You have a class [i]School[/i], each School having a specified amount of [i]Student[/i]'s. [code=cpp] class School { private: String schoolName; vector<Student> itsStudents; public: //Put functions here //Like: String GetName() const {return schoolName;} }; class Student { private: String name; String adress; int …

Member Avatar for Manutebecker
0
104
Member Avatar for singhraghav

I'm supposing you're obtaining user input by using: [code]cin >> name;[/code] If you are, I suggest you read [URL="http://www.daniweb.com/forums/thread90228.html"]this thread[/URL]. The problem with cin is it only takes input till a whitespace is found, so you're only using the first word.

Member Avatar for BeyondTheEye
0
116
Member Avatar for singhraghav

[code]if( s=="m" || "male")[/code] Should be [code]if( s=="m" || s=="male")[/code] You have to compare it to the s variable again, else it will evalute "male" as a char array, which will always return true.

Member Avatar for unbeatable0
0
103
Member Avatar for anbuninja

Suppose the annual interest rate is 10%. It means you'll get 10% of whatever amount is stored on an annual basis. Be it the case you have 100$ deposited for a whole year at 10% interest rate. [code=cplusplus] int deposit; float interestRate, interest; cin >> deposit; //In this case 100 …

Member Avatar for Lerner
0
114
Member Avatar for robgeek

There's nothing wrong with the program. You're succesfully opening it. To have the effect you want, you first need to get the data from the file then write it back to the screen.

Member Avatar for robgeek
0
302
Member Avatar for Dannyo329

There's plenty of programs out there which record keyboard input and mail it through. I'm supposing you could use one of those. Note, I wouldn't trust all of those to be safe...

Member Avatar for BeyondTheEye
0
118
Member Avatar for ohnomis

sqrt(-1) = 1 * i Where i can't be defined. You can't calculate it. So if you were to return it as a result, it'd have to be a string like this: "<Real part> + <Imaginary part> * i", in this case it would leave "0 + 1 * i", …

Member Avatar for ohnomis
0
863
Member Avatar for egsonas

Sounds like you want something like this... Note that this code won't compile. It was just an example, with it still being your work to implement it. [code=cplusplus]class Ship { std::String GetType() {return "Ship";} } Ship aShip; std::cout << "This is a " << aShip.GetType();[/code]

Member Avatar for VernonDozier
0
255
Member Avatar for Jennifer84

The only way I know is by using the System::Drawing namespace. It allows you to define brushes, and with it fonts, colors, text formatting(including bold). [code=cplusplus] System::Drawing::Brush^ testBrush = Brushes::Black; //System::Drawing::Font::Bold System::Drawing::Graphics::DrawString("Use this to draw a string", someFont, testBrush, somePoint);[/code] You should be able to add the bold property to …

Member Avatar for Jennifer84
0
130
Member Avatar for Jennifer84

You could try this, worked for me in a StripToolMenu. [CODE=cplusplus] this->richTextBox1->Checked = true; this->richTextBox1->CheckState = System::Windows::Forms::CheckState::Checked //You can leave System::Windows::Forms:: off if you're using the namespace[/CODE] Sorry, thought you were asking about getting a row to appear as checked. Either way, I'm supposing there should be something similar to …

Member Avatar for Jennifer84
0
132
Member Avatar for juma denice

You should at least try to write some code if your own... If you already have, post it. If you're really clueless on how to even start on this, you need a method to generate a random number(stdlib.h includes one) and a loop.

Member Avatar for BeyondTheEye
0
102
Member Avatar for AlSal

You can find a pretty good reference [URL="http://www.cplusplus.com/reference/"]here[/URL]. Doubt it's complete, but it has most commonly used libraries.

Member Avatar for BeyondTheEye
0
93
Member Avatar for BeyondTheEye

Using a windows forms application, most appropriate thing to use seems a listbox. Been searching around a bit, but I never found anything which seemed to explain it thoroughly. The idea is to load data from an XML file, and then display it in a list, presumably a listbox. Basically …

0
57
Member Avatar for bhoot_jb

Just thought I'd throw in that little bit I do know... In your Point destructor, you're freeing the memory allocated by the coords_array. But what you're actually doing is only deleting the first entry of the Array. All the rest will be stored. To delete all of it's elements you …

Member Avatar for bhoot_jb
0
116
Member Avatar for BeyondTheEye

Well, the basic structure is a form which uses multiple classes defined in seperate files. Below is my controller class which is supposed to keep track of which files are opened. It's included in both the form and the [i]Map.cpp[/i] file, which contains all Map function implementations. I'm supposing these …

Member Avatar for BeyondTheEye
0
259
Member Avatar for BeyondTheEye

I made a win32 application in Visual C++ 2008 using the Windows Forms Application. But for opening files, and saving eventually, havn't gotten to it yet, I was creating some basic classes in other files. The odd thing is the [i]stdio.h[/i] file seems to be working differently in VC. I …

Member Avatar for Narue
0
266

The End.