49,761 Topics

Member Avatar for
Member Avatar for Kris_3

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 …

Member Avatar for Kris_3
0
235
Member Avatar for m.a.u.

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. …

0
90
Member Avatar for Reshiram27

Can someone help me about converting numbers to roman numeral 1-999 via switch statement ? please help me !

Member Avatar for jwenting
0
627
Member Avatar for red11

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 …

Member Avatar for Hiroshe
0
607
Member Avatar for Moaid

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 …

Member Avatar for DeanMSands3
0
248
Member Avatar for coxxie

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 …

Member Avatar for NathanOliver
0
3K
Member Avatar for doreen.lata.14

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

Member Avatar for Saboor880
0
204
Member Avatar for boyalexutzu

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 …

Member Avatar for boyalexutzu
0
238
Member Avatar for Joemeister

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(),"#"); }

Member Avatar for L7Sqr
0
196
Member Avatar for Kris_3

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 …

Member Avatar for Kris_3
0
176
Member Avatar for Saboor880

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" …

Member Avatar for Schol-R-LEA
0
170
Member Avatar for Joemeister

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: …

Member Avatar for iamthwee
0
164
Member Avatar for chris99

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 …

Member Avatar for chris99
0
240
Member Avatar for singersongrita

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 …

Member Avatar for happygeek
0
154
Member Avatar for Jack_9

Is C++ worth learning for webapps? I know python and it works well, so would it even be worth it to learn c++?

Member Avatar for Jack_9
0
157
Member Avatar for DavidB

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 …

Member Avatar for DavidB
0
3K
Member Avatar for Joemeister

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 …

Member Avatar for iamthwee
0
295
Member Avatar for rela

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?

Member Avatar for NathanOliver
0
190
Member Avatar for exoruel

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. …

Member Avatar for exoruel
0
200
Member Avatar for Sinz_1

- 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 …

Member Avatar for Schol-R-LEA
0
223
Member Avatar for Joemeister

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 …

Member Avatar for iamthwee
0
328
Member Avatar for Raaavennn

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, …

Member Avatar for David W
0
213
Member Avatar for Kris_3

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 …

Member Avatar for mike_2000_17
0
200
Member Avatar for Yahia Farghaly

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 …

Member Avatar for Moschops
0
440
Member Avatar for Yahia Farghaly

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 …

Member Avatar for David W
0
172
Member Avatar for Jjajangmyeon

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 …

Member Avatar for vijayan121
0
181
Member Avatar for Jjajangmyeon

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|

Member Avatar for vijayan121
0
312
Member Avatar for nathan.pavlovsky

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.

Member Avatar for nathan.pavlovsky
0
456
Member Avatar for Kris_3

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 …

Member Avatar for Kris_3
0
132
Member Avatar for aluhnev

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 …

Member Avatar for NathanOliver
0
222

The End.