49,761 Topics
| |
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 … | |
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 … | |
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 … | |
| What is the purpose of static member functions in a class? |
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 … | |
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 … | |
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 … | |
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 … | |
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? … | |
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] … | |
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' … | |
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 … | |
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 = … | |
**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 = … | |
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, … | |
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 … | |
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 … | |
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 … | |
/*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 … | |
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 … | |
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 … | |
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: * *** ***** ******* | |
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 … | |
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 … | |
program to read list of words in randomly and displays them in alphabetical order using function and comparison operator. | |
| 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 … |
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: … | |
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 … | |
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). … | |
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 … |
The End.