49,761 Topics
| |
i just installed c++3.0 in XP downloaded from internet . But when i run very simple COUT<<"hello" code it doest produce out put. As i compile and run with out error but no output i can see. I have LCD is there any problem even i chaged the LCD and … | |
The title isnt too clear, and I wasnt sure what to title it, so Ill explain it here. I am making a calculator that can handle big numbers such as scientific notation and powers. A big number is one decimal (coefficient) times ten to a power (exponent). Ex. 3x10^15 or … | |
Write a function that accepts an int array and the array’s size as arguments. The function should create a new array that is [B]twice the size of the argument array[/B]. The function should copy the contents of the argument array to the new array. I tried to run on it, … | |
I am working on an assignment and was wanting to know if one of u guys could let me know if I have 1. correct before I go to 2. Here are the instructions... 1. read in the data then displayed the data. 2 Add the following a. add a … | |
Hi, I'm trying to find a way to calculate the eigenvalues and eigenvectors for a square symmetrical matrix. I have used MATLAB to do this before and the solution was as simple as; [V,D] = eig(A) I'm wondering if there is a simple solution like this in c++. I am … | |
My assignment is: Your goal is to write a program that sorts a list of 4-letter words using different sorting algorithms and report the fastest method. First your program should prompt the user to indicate the number of words to generate. Your program should then generate a list of random … | |
[code=cplusplus]#include <iostream> #include <conio.h> #include <iomanip> #include <fstream> using namespace std; const int numStudents = 5, numQuiz = 10, numAssign = 10, numFinal = 1; const int totalGrades = 21; void computeStudAver(const int grade[][numQuiz], double stAve[]); void computeQuizAver(const int grade[][numQuiz], double quizAve[]); void printall(const int grade[][numQuiz]); int menu(); int main(); … | |
Hi all, I was wondering if there is any standard way in C++ (perhaps in the standard library) of handling mathematical equations that are composed of +/- signs. For instance, if you are given the equations: [quote] y = +/- sqrt(x) z = +/- y [/quote] Is there an efficient … | |
I have a code and its almost done. Its for a school project and I am stuck. I have DivSales and a CorporateSales.cpp. The programs should ask the user for 6 divisions quarterly sales. Display the results into a table and give a total of sales. My total feature is … | |
This code: [code] #include <iostream> class Parent { int name; class Child { int school; void test() { std::cout << this->name; } }; }; int main(int argc, char *argv[]) { Parent MyParent; return 0; } [/code] Generates this error: [code] error: 'class Parent::Child' has no member named 'name' [/code] Is … | |
For some reason i cant output to a file unless it was already created. Here's my code. [code] fstream myfile; myfile.open (filename.c_str(), ios_base::in); if (!myfile) { myfile.close(); myfile.open (filename.c_str(), ios::out); avatar.name = name; avatar.init(); myfile << "Name = " << avatar.name << endl; myfile << "hp = " << avatar.hp … | |
hello all, I'm taking a C++ class at my local community college. A project that was assigned was to make a menu program. I am about 90% done (I think), when I ran into this issue: when making a selection, the program doesn't know how to handle decimal numbers. The … | |
I have some code that uses _finite (I think from float.h) that my linker complains is not declared. I think this might be a "windows only" function. Is there an equivalent function that I can call that will work cross platform? Thanks, Dave | |
i have to write a program that will read in a txt file that also has periods, exclamations, question marks and <CR>(returns). and do some other stuff. right now i am having trouble with comparing the words..... this is at the very bottom of my code [CODE]#include <iostream> #include <fstream> … | |
I've been tasked with implementing either the min-max function or alpha-beta pruning to code AI for the game Gumoku (connect 5, vertical, horizontal, or diagonal). In both algorithms an evaluation function is called to analyze the board of play. Is there any "easy" way to do this? My initial plan … | |
Hello, I am wondering how its possible, to make a server that you can connect to it, through IP and Port and than send data to it, For example I am trying to make a simple multiplayer game. But I am really amateur on connections etc. So please help me … | |
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 … | |
Hi there! I'm new to c++ and I'm having problems with ifstream. I assume that my question is pretty stupid but here you go: I've got something like: [code=c] ifstream infile(inname); [/code] Furthermore I do have an array - let's call it Array - which contains several filenames I want … | |
[CODE]#include <iostream> #include <list> using namespace std; template <typename T> class superlist : public list<T> { public: // squish() is a mutator that "squish" together adjacent duplicate // elements in a list. // // Example #1: // [3, 3, 4, 3, 3, 3, 2, 8, 8] // becomes... // [3, … | |
Hi Guys I want to build an application which can be used to empty the content of bad (remapped) sectors. At the moment I really dont know where to start, so I am hoping someone can give me a push in the right direction. It would also be nice if … | |
So I made a template...I tried declaring a string linkedlist like so... [CODE]LinkedList<string> str; [/CODE] Then i called the function insertLast to insert a string called hello..like so... [CODE]str.insertLast("hello")[/CODE] Then it gives me null pointer error...I cannot see how there can be a null pointer...help would be appreciated..Here is the … | |
Hi all, sorry to once agian come begging for help, but the professor wants us this time to have the program have a function read the word then for each letter have another function confrim if the letter is a vowel or not, then have the first function remove the … | |
| I have following peace of code, when i check it with valgrind it gives me "537 bytes in 19 blocks are possibly lost in loss record 12 of 12" Following is the code: CManager.h [CODE]class CManager enum RespType_en { eInvalidRes = 0, eAuthRes, eActivateRes, eSetStateRes } map<RespType_en, string> m_mRespTags; [/code] … |
Hi everyone! I'm new to C++ and i was told Dev CPP is a good compiler. I installed it and anytime i try to open it comes out this message: There doesn't seem to be GNU Make file in PATH or in Dev C++'s Bin path. Please make sure that … | |
I need some help with postfix expression please. I've only been able to find examples about changing from infix to postfix. With the code provided below, I want it to the following: 1. if the token is an operator (it is a +, -, *, or /) a. two items … | |
Here's my code for the upright triangle. Now I'm hard up on doing the code for inverted triangle, I'm working on it right now, but a little help would be great. [CODE]#include <iostream.h> #include <conio.h> void main() { int len,ht,ch,cho,sz,col=20,ctr=1; cout<<"\nTRIANGLE"; cout<<"\nEnter Size: "; cin>>sz; if (sz<5||sz>20) cout<<"Size must be … | |
I am trying to compile some old code a colleague gave me. I have MyClass.h [code] class MyClass { public: static int UseIndex; .... }; #include "MyClass.inl" [/code] MyClass.inl [code] ... int TreeNodeData::UseIndex=1; ... [/code] I am getting: [code] multiple definition of `MyClass::UseIndex' first defined here [/code] I got several … | |
I have a CString : CString data; data.Format = ("!64.8 Px.1= 1200"); I would like to copy the number 1200 from data to another CString data2. Anyone can help? Thanks in advance | |
So i have Class Parser and in this class is constructor [CODE]Parser(string s){ // constructor tokens = s.c_str(); // convert to a C string opStack.push(END); // initialize opStack }[/CODE] tokens was defined as const char *tokens in private ; That is in the parser.h file However when i try to … | |
i need a c++ compiler with a graphical user interface which can easily be used and that contain many option like for example microsoft visual ,simply i can write the code on a gedit and compile it by using : g++ "file name" -o test ./test but it is so … |
The End.