49,761 Topics

Member Avatar for
Member Avatar for jorge.carmonajr

Okay so i am really new to coding(about 2 weeks) and need help with an assignment.the asignment goes like this "Write a program that will read in a file named pa7-temp.txt (located in the current directory) that contains a set of temperatures, and then prints out how many were in …

Member Avatar for np complete
0
208
Member Avatar for php111

Hey everyone, What book would be recommended to learn C++ between Prata C++ Primer Plus, or the C++ Programming Language by Bjarne Stroustrup? I believe C++ Primer Plus would cover everything, but does someone need expirence in order to read the book by Bjarne? Does the Bjarne book covers everything …

Member Avatar for mrnutty
0
599
Member Avatar for b1b2b3b4

I have to create three shapes, **Square, Cross, Rectangle**. This makes up three classes. There is one super class, **Shape**. So basically when I did not try any of the polymorphism but I did declare: class Shape{ private: int x,y; public: ... } class Square: public Shape{ } If I …

Member Avatar for b1b2b3b4
0
222
Member Avatar for danibecse
Member Avatar for NathanOliver
0
218
Member Avatar for Kirielson

In C++ it seems like every single time you open a file, the inner contents get deleted quickly. Is there a way to open the file at the end of the last character while keeping all contents within the file? I've been looking at something with the End of file …

Member Avatar for ankit1990rana
0
8K
Member Avatar for AutoPython

I've been at a loss as how to convert the std::string to char (Line 40). I've tried c_str() and a few other things, but it's really confusing when the pointers are thrown in there. I know I'm kind of asking you guys to do it but I don't know what …

Member Avatar for rubberman
0
431
Member Avatar for akashi

hi! I'm new in c++, can anyone give some instruction how I'll start this structure solution? if so, please give me some instruction Problem given: Define a structure called Toy with the following members: . Name of Toy . Price of Toy . Made in (the place where the toy …

Member Avatar for spuriousgeek
0
119
Member Avatar for coroshea

I have the following as an Stl algorithm/vector: MyClass <int> VecOfInts("A vector of integers"); VecOfInts.push_back(3) VecOfInts.push_back(2) VecOfInts.push_back(1) I was able to get the numbers to display with a for loop (i < VecOfInts <size; i++). Now my question is: how would I get "A Vector of integers", to display, irregardless …

Member Avatar for vijayan121
0
136
Member Avatar for sonum04

hey sir, i need your help to solve a program? question is= write a program for assesment system of university. the basic idea is to calculate the GPA of each subject and then calculate the GPA of whole semester and the basic of that GPA calculate the grade and remarks? …

Member Avatar for np complete
0
99
Member Avatar for lonelycloud

I've been trying to write a class called Point, with a file Point.cpp including a header file Point.h . I tried to set a global variable of type Point called ORIGIN, however I get an error message saying "error: ‘ORIGIN’ does not name a type" Point.h is as follows: [ICODE] …

Member Avatar for Lizino
0
2K
Member Avatar for christinetom

Hi all Can anyone tell me how I add a linker directory for a specific library to my project in Codeblocks. It would be better if it was there all the time but I think I have to go to Project>Build Options> then I have to select the 'Search Directories' …

Member Avatar for christinetom
0
2K
Member Avatar for mchung90

Hello! I am currently attempting to read all the lines from a text file, and append them to one long string. At the moment, it seems that the line that is read in keeps overriding the string, instead of appending it. I think it has something to do with the …

Member Avatar for nullptr
0
320
Member Avatar for s123456

assuming everything else works...i'm having trouble with the output...the if else statements are driving me crazy. it is outputting the date twice when i enter 7/3/12 code displays todays date....displays "payday" entered......adds 7 days to "payday" to show NEXT payday. void Date::addDays(int month, int day, int year) { _day = …

Member Avatar for MandrewP
0
147
Member Avatar for venkyHyd

**I have tried to display URL(contain unicode characters) response in Message Box. But garbage characters displaying, so that i tried to made different conversions, but alphabits only displaying remaining unicode characters displaying as ?(or)garbage values. im trying this from 3 days..plz help me...plz write the complete code.** HINTERNET hInternet = …

0
41
Member Avatar for sofy

my task is to type 20 integer numbers from 0 to 99 as the input data. few tasks are to check the maximum and minimum, and find the total number of even and odd numbers. (this one i already got the answer). But i have problem for my next task, …

Member Avatar for sofy
0
359
Member Avatar for sofy

not sure if this is the right place to ask, but i need some help for my problem here. i want to find inverse, upper triangular and determinant for a matrix. but i'm not sure why it doesn't work like what i want. for now, i just want try to …

0
120
Member Avatar for francis.deladurantaye

Here is my code. I have a problem with the decimals when it comes to "temp /= 100.0". montant = 61; for (int i=0 ; i<7 ; i++) { if (i != posCreancier) { temp = montant/7.0; (temp == 8.7142857142857135) temp *= 100; (temp == 871.42857142857133) temp += 0.5; (temp …

Member Avatar for Ancient Dragon
0
131
Member Avatar for mitchell5879

Hello, I am having a problem with the output for my sub-string generator program. input: abc desired output: a, b, c, ab, bc, ac, abc current output: abc, abcc, abcb, abcbc, abca, abcac, abcab, abcabc I am sure the error is right in front of me, but I have been …

Member Avatar for zhizu
0
172
Member Avatar for CodyM

/*I'm having trouble creating a constructor for degree and *coeffs as well as properly creating the dynamic arrays for the coefficients of the 2 polynomials a and b. I'm just concerned about getting the correct values. My textbook only gives us eamples of constructos for eamples not well related to …

Member Avatar for CodyM
0
225
Member Avatar for CodyM

So my readPoly fct assigns the values i want to my dynamic array, but when the fct send Polynomial p back to main to be assigned to a and b(fct called twice) the first value of the array is set to 0. I've output the array inside readPoly and it …

Member Avatar for CodyM
0
288
Member Avatar for daniel.moore.5099940

Hey everyone, i need help with this program im doing for a class, now i havent used c++ in a while so thats why im considerably fresh in all this. any at all help would be greatly apprecietated. ALso i can NOT spell to save my life. the problem states …

0
145
Member Avatar for arslan.haroon

Hey! I am stuck on a problem in which i have to print an isosceles triangle (two sides equal) with any character. It would be really helpful if someone could tell me the code, the triangle should look like this: * *** ***** *******

Member Avatar for hariskhank
0
103
Member Avatar for akashi

hi! can anyone solve this string-array problem or give me just an example about it * Write a program that converts a sentence input by the user into pig latin. You can assume that the sentence contains no punctuation. The rules for pig latin are as follows: a) For words …

Member Avatar for Lucaci Andrew
0
914
Member Avatar for sblass92

Hi all, To begin, I'm not certain this is the proper place to start this question, but I believe this to be a linux-linker related error rather than a code based one. I've also searched far and wide for a solution online, but others have solved the problem simply include …

Member Avatar for sblass92
0
268
Member Avatar for rajeshyadav6382

program to read list of words in randomly and displays them in alphabetical order using function and comparison operator.

Member Avatar for Lucaci Andrew
0
43
Member Avatar for k3na26

Hi, I kind of need help with my homework. I already have a code but it doesn't seem to work. I'm confused about the parameters I put. I don't know which part I actually messed up. I don't know what else to do. Thank you so much in advance for …

Member Avatar for satabios
0
3K
Member Avatar for starletcharmed

Hi, can anyone help me with my code? Im trying to reverse my string using stack... but when it compiles and put in a string and press enter... nothing happens... Any suggestions? [CODE]#include <iostream> #include<stack> #include<string> using namespace std; int main() { stack <string> s; string a; cout << "Enter: …

Member Avatar for d_a_y_o
2
4K
Member Avatar for Carc369

How do you do that? This code reads in the book. It reads in fine. Now I just have to alter it so it doesn't read in repeat words in the book. How would I do that? void readInStory(){ ifstream inStream; // declare an input stream for my use int …

Member Avatar for vijayan121
0
696
Member Avatar for Carc369

I've tried cin >> userInput; and it stops reading the word after it hits a space. but then I tried cin.get and it just skips all the other cins. Then I tried cin.getline and it skips over the userInput cin and goes right to the next cin (cin >> direction). …

Member Avatar for vijayan121
0
567
Member Avatar for Elixir42

Hi I am getting some strange results from my framerate calculation. It seems to have a mind of its own. It wants to stay at about 60 fps even if I set it to 80fps. It does run though if I set it to 50fps. I am getting smooth movement …

0
78

The End.