49,761 Topics
| |
Hi guys so I just finished all the basic tutorials on C++ on this channel [Click Here](https://www.youtube.com/playlist?list=PLS1QulWo1RIYSyC6w2-rDssprPrEsgtVK). I don't know if its any good but it started me off. But now I have watched everything and I am wondering where to continue and I decided to ask here. Any good … | |
| Greetings everybody, I have been developing a C++ project in VS2010. When I was writing data into a file, everything was ok. I modified the program to write data into a new array instead of a file. I had an error of stackoverflow. I checked the datatypes, array lengths etc. … |
Can someone help me about converting numbers to roman numeral 1-999 via switch statement ? please help me ! | |
Uhmm. I need help! I need a code in our case study. And I don't know how to start it. Please, someone help. I need to pass this on thursday, August 21 2014. Huhu :'( I really don't know. I'm no IT/CompScie or whatever computer related courses but I have … | |
im using windows 7 64bit along with codeblocks and mingw and im trying to use non standard c++ libaries such as SDL , allegro and sfml but when i link them and try to compile the examples some work and some dont i wonder what i did wrong ? I … | |
Develop class Polynomial. The internal representation of a Polynomial is an array of terms. Each term contains a coefficient and an exponent. The term 2x 4 has the coefficient 2 and the exponent 4. Develop a complete class containing proper constructor and destructor functions as well as set and get … | |
A need a program that will ask the persons age , type of car needed and the number of days the car is needed. if the driver is <= 25 years of age than 20% surcharged | |
Hello guys, I'm new here and with C++ and i have a problem if you are kind to help me. Me and my friend have created a small program that download yt videos and upload them on specified yt accounts entered by us, when i hit run it opens 50 … | |
I want to know how I can do this: 1. Find "sqrt" in a string 2. Replace "sqrt" with only "#" I have the following code but its not working. Why? size_t found = 0; found = modifiedExpr.find("sqrt"); if(found!=std::string::npos) { modifiedExpr.replace(modifiedExpr.find(sqrt),sqrt.length(),"#"); } | |
Hi again, so guys I want to add some color to my text but all the explanations I find are some links to complicated ways of doing it with almost no explanation of the operators functions and so on. Could you show me an easy way to make for example … | |
Hello to all! I am using compiler Dev C++ but i am facing a problem in with it. Sometimes it happens that if i try to run one program , it displays the output of another program instead of required program. For example I have two programs named as "Pointer" … | |
Let me explain what I want to do: I want to change a expression like this: x * (2 + 3) - (y + 1) to this: 5 * (2 + 3) - (6 + 1) using this: instVar('x', 5); instVar('y', 6); The problem is I get the following output: … | |
I am trying to create a window with a custom background after playing with the different styles, to practice declarations and destroying objects for future reference. Whenever I try to compile the code I get the following errors: "undefined reference to CreateSolidBrush@4" and "undefined reference to DestroyObject@4". Where in my … | |
I learned how you can use the switch statement to make the program go through the stuff inside and choose the one that matches the condition set. Isnt that basically what "if" statements do? so does this mean we can completely replace 'if' with 'switch'? because it seems way more … | |
Is C++ worth learning for webapps? I know python and it works well, so would it even be worth it to learn c++? | |
For the past while, I have gotten comfortable doing things a particular way when it comes to inputting data: i) create text file whose first entry is N, an integer indicating the number of data entries following, and the actual data entries. For example, for 101 data values, the text … | |
I am getting errors when I'm trying the following: instantiateVariable(string startingExpr, char var_, int val_) { int sizeArray = startingExpr.length(); //Convert the int into a char/string int number = val_; string newChar = ""; ostringstream temp; temp << val_; newChar = temp.str(); //Searching for the variable in the array for(int … | |
I have to do my project using C++, should I firstly read a book about that and after that write the programming, or it's better to start wtiring my code and solve my problems and questions at the same time? | |
You pros are once newbies like us. Hoped you might take a little time sharing your expertise. Got freaked out when our teacher gave us this activity, where she haven't taught this to us yet. So this is the activity (LOOPING) : Write a program that accepts a positive integer. … | |
- When i'm trying to delete the first number of list, something went wrong when i print the list? - Can anyone help me? Thanks so much T_T. - Here my code: #include <stdio.h> #include <conio.h> #include <stdlib.h> struct node { int inf; node *next; }; node *insert_head(node *first, int … | |
Hello all, I am getting 3 errors when I try to use stacks when I want to evaluate a postfix expression. I am not very experienced with the usage of stacks so please be patient with me. Here is my code: //The postfix parameter is a postfix string that was … | |
Hi please help me, im trying to make a program that only accepts numbers. What can I do to disable letters and special symbols? for example, I enter "sffsdttsfsjfs" / "!%#^$*$(" then the program would prompt that "Error: Letters and Special Symbols are not allowed" I saw a thread here, … | |
So I just started using the Goto command and I have some trouble with it. I will post my code and explain the problem. cout<<"So here we are at your first choice."<<endl; cout<<"-Do you 'stand' there and TRY to get me out of your head..."<<endl; cout<<"Or do you 'follow' the … | |
hi all, while i am learning the overloading operators ,i studied the following syntax ostream&operator<<(ostream &, classname&); i understand how it works but only something that i don't understand is the use of (&) with ofstream class ?at this point what's happening ? also i notice that i can do … | |
Hi all, for the code shown below , every thing is okey except few things i output the obj[i](sure the [] is overloaded) with the overloaded << but inside the operator definition i was outputing the m data member of the reference object,how ever it also outputs the m data … | |
Nothing special - I just need to grab a line and slap it into a string - if(found == 1) { cout << "\n\n Please enter a new location for this event: \n"; getline(cin,newAct); cout << "New Account: " << newAct << endl; } else { cout << "\nEvent not … | |
I'm new to using vectors, and I'm trying to declare a vector with size 1: vector<string> activities(1); I get an error with this code, can anyone explain why? G:\ManageActivities\Activity.h|11|error: expected identifier before numeric constant| G:\ManageActivities\Activity.h|11|error: expected ',' or '...' before numeric constant| | |
Is it poor convention to create a c++ file only to store various functions, and then include it into the main.cpp? This would be done so that the functions could be used in different programs as well. | |
Hi guys so I am still learning and there might be an easier way to do thing than how i do them but still i need some help. So I was thinking of making a program in which it asks you a question , lets say Yes/No question and you … | |
class Animal { string _name; string _type; string _sound; // private constructor prevents construction of base class Animal(){}; protected: // protected constructor for use by derived classes Animal(const string & n, const string & t, const string & s) : _name(n), _type(t), _sound(s) {} public: void speak() const; const string … |
The End.