General C++ Programming - October 2010 (Page 5)

File output
 
Hey, I was just having a little trouble with the file output in c++, i'm converting a program from c and the program opened a file, fgetc until it reached the r...
[1 reply] : http://www.cplusplus.com/doc/tutorial/files/ http://www.cplusplus.com... (by Null)
String from a file
 
I have a text file that reads like: Mike Thomas 100 Main Street 1009 456 199 John Smith 200 Second Ave etc...... I can get the values I need but ...
[2 replies] Last: To get a full line and not just up to a space do this: #include ... (by OHGxLeetGamerxOHG)
by cric
stringld function can someone do it?
 
Problem A: String LD Stringld (left delete) is a function that gets a string and deletes its leftmost character (for instance Stringld(“acm”) returns “c...
[7 replies] Last: Hey now, I wasn't actually trying to give him(or her I suppose) a viab... (by ultifinitus)
by chee
Using Queue/Stacks with classes and Nodes
 
so basically this programs works, but with 1 problem and i know how to fix it, but don't know how to put the code in. the error i get when i put the code i w...
[1 reply] : template <class T> class Node1{ public: int data1; Node1<T> *ne... (by ne555)
by wtf
control skipping over switch statement, and following code within function.
 
This is baffling me. inline void upper(char & ch) { cout << "ok in upper ch = " << ch << endl; //exit(43); switch(ch) {cout << ...
[13 replies] Last: copy = yada; This doesn't copy what's in yada to the memory point... (by filipe)
Multiple Iteration Schemes
 
Displayed are 2 Categories each with 5 slots. I am able to Click slots and change there color in this fassion: 1st Slot <--Click and it changes from black (i...
[1 reply] : Efficiency is my concern here. I broke everything up so it is easier t... (by lampshade)
ifstream ubuntu doesn't read
 
Hi! I have a very simple question for a simple code. Why doesnt it read the content of my file? I use ubuntu 9.04, the file is in the same folder as the sourc...
[no replies]
try catch creation style
 
I'm trying to make a decision with respect to creating objects inside of try blocks. At work we have a standard to try and keep our try catch blocks as small...
[9 replies] Last: +2 moorecm the harm we're concerned about with putting entire mo... (by jsmith)
The end of my loop is not working right
 
Okay i am doing a program for class and when it goes to end the loop the last parts come up. How do i fix this. (program is below) #include <iostream> usi...
[2 replies] Last: thank you very much (by PrincessProgram)
by balteo
Beginner needs guidance with basic C++ syntax
 
Hello, I have the following class, "ApplyFoo". Can anyone please tell me what this means: ApplyFoo( float a ) : my_a(a){} First it seems there is a c...
[2 replies] Last: I see... Thanks. (by balteo)
ncurses - creating an array of windows
 
Hi all, I hope someone here has enough exprience in ncruses to answer my question. I have defined in my ncruses based program several window variables as ...
[1 reply] : Declare an array of pointers to WINDOW ( WINDOW *array_win ; )... (by Bazzy)
cout statment after a do-while, within an if-else
 
Hey! I've got a C++ program due in about an hour! I need help! I've got a 'do-while' within an if- else. I want an output statment after the do-while, but...
[1 reply] : Compiled it. It worked. You just have to pause the program (for exampl... (by hamsterman)
linux redirection program solution?
 
The Green Tree Service Company offers the following services to its customers: * tree planting - $35 for a small tree, $100 for a medium tree, $250 for a lar...
[3 replies] Last: is this a good start? #include <iostream> #include <iomanip> ... (by xeroskye)
by Ulvain
Window sizing
 
#include <iostream> //the following line is necessary for the // GetConsoleWindow() function to work! //it basically says that you are running this // p...
[2 replies] Last: I cannot think of any practical reason why you'd need to move/resize t... (by Disch)
Procedure that returns list<MyClass> cannot compile
 
Hello all, I have a class called MyClass defined in C++. And I have a procedure that wants to return a list with MyClass objects. I have the procedure de...
[5 replies] Last: Thanks, std::list solved the issue! =] (by Ana Developer)
overloading operator+
 
So what i'm trying to do, is add a number to an array in my object, and if needed, allocate more memory to it. my directions are: Create a pointer to an i...
[1 reply] : Why would you want to change the original "right" (which is actually t... (by Zhuge)
operator<< problem
 
Hello everyone, I'll get right to it... I get this error: date.cpp: In function ‘std::ostream& operator<<(std::ostream&, const Date&)’: date.cpp:159...
[3 replies] Last: But somehow that was really it, can't believe I looked that over... Th... (by gamerkruger)
Good day everyone!
 
Hi everyone I'm new here, I'm using English but not so good. Hopefully I can share my few experience with all of you. For the first post, I wanna ask about u...
[2 replies] Last: @Bazzy: woah..it works! just now I compiled your syntax and it does g... (by rozzaaq)
Read File (possibly image) as binary?
 
I want to read an image file as binary, then save it again in its binary form, however i am having some problems as i cant seem to get it to read the file as bi...
[14 replies] Last: sorry for asking... may i know the final coding? (by redzwan)
Simple tree template class using vectors
 
Hi: I would like to make a really simple template class using vectors, something like the following: #include <vector> using namespace std; ...
[6 replies] Last: Hi kbw: After thinking about why I needed the tree in the first... (by alexmbcm)
October 2010 Pages: 1... 34567... 23
  Archived months: [sep2010] [nov2010]

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