- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 8
- Posts with Upvotes
- 6
- Upvoting Members
- 7
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
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 … |
|
Re:
does anyone know how to convert c program code into c++ program code? I have program written in c code, but need the same program and its functions in c++. I can post code if needed. Thanks. |
|
[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 … |
|
Re:
I have the following code that tests a string to see if it is a palindrome. The only error I am getting is when I try to pass each character to the queue and stack. Is there another way to pass it to each? [CODE]//Implement the palindrome-recognition algotithm described in … |
|
Re:
Anyone who can help me please do I am totaly lost. this is the homework: You will implement a set of functions that will analyze and/or manipulate character data. You are provided with a header file called charRoutines.h that contains the declaratins (prototypes) for the functions that you are to … |
|
Re:
A criticism of the break and continue statements is that each is unstructured. Actually they statements can always be replaced by structured statements, although doing so can be awkward. Describe in general how you would remove any break statement from a loop in a program and replace it with some … |
|
Re:
Hello, I am trying to make an rpg, and I am having troubles with functions. I am currently working on the 'potion' aspect of my rpg, which I have highlighted in red. My question is this: Is it possible to make the function return money, potion number, potion size, etc? … |
|
Re:
Hi guys, Sorry to ask a question as my first post. I'm totally new with c++ and I couldn't understand much about vectors. [CODE] case 1: { cout<<"Enter [S]avings Account , [C]hecking Account,[G]eneral Account"<<endl; cin>>selection; if ((selection == 'G') || (selection == 'g')) { acc.push_back(newAccount); cout<<"New account added"<<flush<<endl; break; }//end … |
|
Re:
Write a C++ program that ask the user for the name of a file. The program must have a function that prompt the user to enter a file name and open the file. The program should display the last ten lines of the file on the screen. Each line of … |
|
Re:
I am trying to read a decimal as a char and store it in an array by ignoring "." like if I have 0000.9876 will be stored as 9876. The program works fine...but it doesn't stop when i debug it.....I need help please ........... #include<iostream> #include <ctype.h> using namespace std; … |
|
Re:
Hi, I'm trying to create a quick and small programs that works when you press F9, it should create files on my desktop using "ofstream" from A to Z. I can't get it to run when i put ofstream in a [B]for[/B] cycle. Here is the code to see it … |
|
Re:
This is what I have already but I dont know if I am meeting the specs for my assingment... anyone have any input of what I should do? Assignment is Write a program that will ask the user for a temperature in Centigrade (Celsius) and convert it to the Fahrenheit … |
|
Re:
Is there any functions that split a string? Such as this: [code=c++] string s1 = "lol-lol2-lol3"; string s2[3]; char spliter_char = '-'; split_strings(s1, s2, spliter_char); //s2 should now be: //{"lol","lol2","lol3"} [/code] |
|
Re:
When I declare a new Hashtable such as: String a = null; HashTable<string> = new HashTable(a, 100); It tells me HashTable is not a type. [CODE]#ifndef HASHTABLE_H #define HASHTABLE_H #include <iostream> #include <vector> #include <list> using namespace std; template <typename HashedObj> class HashTable { public: explicit HashTable( const HashedObj & … |
|
Re:
I was trying to implement operator overloading in c-string in the following code [CODE=cpp]#include <cstring> #include <iostream> using namespace std; class string { char *st; int len; public: string():st(NULL), len(0) {} string(const char *s); string(const string & s); ~string(); friend string operator+(const string &s1, const string & s2); friend int … |
|
Re:
Hey guys. This is really frustrating because it seems easy but I can't seem to find the correct function to remove this element of my string. [code] void set::display() const // pre : none // post : displays the elements of this set enclosed in braces and // separated by … |
|
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 … |
|
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 … |
|
Re:
I am trying to overload << for a class complex. The code is: INTERFACE: [code=cplusplus] class complex { friend ostream& operator<<(ostream& output, const complex& V); private: double REAL; double IMG; public: complex(); ~complex(); }; [/code] IMPLEMENTATION of <<: [code=cplusplus] ostream& operator<<(ostream& output, const complex& V) { output<<"("<<V.REAL<< "," << V.IMG<<")"; … |
|
Re:
What I want to do is make a grading system. There is a vector for schools and classes and students, all of these which have their own class, derived from a class called system. [CODE]class System{ School * p; //School Pointer vector<School>sSort; public: //Splash Screen Function void Splash(); }; /*-School … |
|
Re:
i am trying to take input for name and return it with only the first letters of the name as capital....i am able to it the first name but m unable to move on to the second and last name.... please help.. [code=cplusplus] string ToUpper(string n) { for(int i=0;i<n.length();i++) { … |
|
Re:
Hey guys! i Have a prblm writing a program, i hope i can find help here.... in the prgram i have to take user input on gender as 'm' or 'f' or 'male' or 'female' or 'Male' or 'FmAle'.... what i mean is i the input should not be case … |
|
Re:
Im having a hard time where to start with this assignment. Obviously I did the easy part now its time for the loop which i just dont get. heres how the program will run [B]Enter the initial balance ===> 1000 Enter the number of months to cover: ===> 3 Enter … |
|
Re:
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 … |
|
Re:
Ok, Im not trying to be evil or anything but is there anyway I could use C++ to open a website in a window, then record what the user types? So the website is google, and some random guy decides to search up dogs:twisted: , dogs would be recorded some … |
|
Re:
Hello, I'm writing a a program in C++ that adds/subtracts complex numbers. I'm having trouble writing the square root of -1 or "i" in a complex number. Complex number: realPart + imaginaryPart * i (where i is /-1) ["square root of -1"] so far I'm thinking the code is something … |
|
Re:
Hi everyone, I'm writting old "Battle ship" game. I know, that is very funny, but I want my own version, with one objects and inheretancy levels. Here is a plan what I'm reaching for: ---------------------------- object: A-level: - aship - keeps common parameters of floating things B-level - ship - … |
|
Re:
For the code below I Select an area in a textBox that I will Mark Red. I will also change the Fontsize to [B]16 [/B]and make the selected text [B]Bold[/B] but are not sure what calls that is used for this. [code] this->richTextBox1->Select( 0, 10 ); this->richTextBox1->SelectionColor = Color::Red; [/code] |
|
Re:
I am loading a txt File into a textBox with the code below. For each Line I am checking : if( LoadTopic2.substr(0, 2) == "Ex" ) If that is True I want to select that Row and mark that Line Blue. I have started some code out below but dont … |
|
Re:
i am required to write a C++ program code that generates random numbers for a dice and it should have 1000 observations please assist a fellow geek |