Beginners - July 2011 (Page 4)

The tellg,seekg functions (1,2)
 
Hi.I need a function that displays the content of a text file on the console. I've tried doing it like in the following code snippet,but it only works the firs...
[21 replies] Last: @ne55: ¿What happens if you open the file in binary mode? it works,t... (by stupididiot)
Sorting Values From Input File to array
 
Hello, Im having trouble sorting values from an input file into three separate arrays, one holding studentID numbers, a parallel array holding the students resp...
[no replies]
creating a fresh screen?
 
How do you delete previous outputs and inputs to the screen leaving only either a new output or the screen prompt? for example #include <iostream> us...
[1 reply] : Easiest approach is simply to flood the console with new line characte... (by closed account DSLq5Di1)
book with examples?
 
What is a good book for C++ that has a lot of examples, but more importantly has the reader learning a section and practicing what was read?
[no replies]
Pass a Stack by Reference
 
I have a std::stack that I'd like to pass to a function #include <string> #include <stack> using namespace std; bool mess_with_stack(const stack<string...
[3 replies] Last: That was it. Thanks! (by joatmon)
Storing input numbers in an array and counting and displaying them
 
Kinda new to C++, and i dont know how to get this right. I need to prompt the user for an arbitrary number integers and use zero as a sentinel. The program must...
[4 replies] Last: Is this a school assignment or something? You don't seem to be lost, ... (by eidge)
by wtf
Order of operations of operators
 
I've been fiddling around with trying to do something like: class str{string data; public:str(){data = "Hello World!\n";} friend ostream &operator<<( ostream ...
[2 replies] Last: [quote=wtf]So far the best that I can come up with .. Replace = with <... (by closed account DSLq5Di1)
How to compile an executable from more than one language source file?
 
Can you make an .exe from more than one language source file? The reason I ask: I want to make a project in C. But the GUI libraries that are compatible t...
[3 replies] Last: Mixing languages is normally done at the binary level. You can call a ... (by andywestken)
by JCS
custom comparison function
 
Hi all, I am trying to use the function std::sort in the following way: template typename<T> void SomeCLass<T>::some_memberfunction(...) { vector<i...
[3 replies] Last: Hi jsmith, I found the bug: I forgot a semi-column at the end of the ... (by JCS)
Problem with scrolling
 
Here is some pseudocode to model my problem If the player's ( x position + player height ) reaches 436 stop the player and start scrolling. ...
[8 replies] Last: A "Camera" just indicates what part of the world is visible on screen.... (by Disch)
by Konig
Printing all columns of a matrix C++
 
So I can get the first column to print but am lost as to why the others will not, any help would be appreciated. I am VERY new to C++ so therefore may be very m...
[5 replies] Last: Prints out neater. Space + Number = 4. Remove it and see the differe... (by binarybob350)
by Baso
Inheritance privacy
 
Hey everybody I want to ask a question about inheritance . From the child classes could I access a protected data member in the parent class without using ...
[5 replies] Last: For Turbine Thanks for you replies, but you didn't read my topic ver... (by Baso)
Pizza Order won't compile
 
The code is finished, however I need somebody to show me how to make it compile, must be missing something...it is a pizza ordering system. How do I make this ...
[6 replies] Last: int main() { .... } Pretty simple:) (by ModShop)
Pick one? Or pick them all?
 
Okay so im 17, and very very eager to throw myself into the development world. That being said, I find myself dipping my pen in every bucket of paint there is(J...
[19 replies] Last: ah, thank you so much :) will do...C# on the way...then XAML (by AppDevTrainee)
Read a file scientific notation into 2D array in C++
 
I have a question on how to read a file with scientific notation into 2D array. Let's say I have a file with a name "test.txt" and its contents: 1.0e-5 0 0....
[2 replies] Last: So far, I wrote the following code, but I got errors. How could I fix ... (by Antonym)
Display positive numbers in an array
 
This program needs to call a function that displays the positive numbers entered into an array. The program is either ignoring the function or the code is wrong...
[6 replies] Last: [quote=Rebecca Bubenheim]Any suggestions? Start a new thread in the fo... (by lnk2019)
How to remove 'excessive' decimal points?
 
I'm making a small calculator using C++. The problem is that I used "fixed" to show the decimal points for non-integer values. So, even if I write 1+1 to get 2,...
[no replies]
SDL surface not showing
 
The previous state's render function works perfectly, so i dont know why this state wont draw the image. Here is the render function for this state void Men...
[3 replies] Last: NVM i got it lol (by nano511)
infinite loop,
 
what's the problem with this one, it seems that everything is fine until i enter the second input after i entered it it will have an infinite loop, #include<...
[11 replies] Last: thanks man (by AppDevTrainee)
by nanger
about the size of a derived class
 
class Base { int i; } class Derived:public Base { } Derived d; we know that d.Base::i is different from d.Derived::i so it seems th...
[7 replies] Last: Agree to CodeMokey! The class of drived has a pointer to the Base::i,... (by lijun)
July 2011 Pages: 123456... 54
  Archived months: [jun2011] [aug2011]

This is an archived page. To post a new message, go to the current page.