General C++ Programming - March 2010 (Page 19)

Output to two streams
 
I was wondering if there was a way I could have a stream for logging output to stdout and a file. ...
[13 replies] Last: I would say boost is almost standard. A lot of stuff from boost is get... (by tummychow)
vector of function pointers
 
I'm trying to do something like this... void testfunc() { cout << "hello" << endl; } int ...
[8 replies] Last: Ah alright. It wasn't working before with .at but now it is. :) Tha... (by closed account Sy0XoG1T)
[stdlib.h] free doesn't invalidate
 
Hi, when I was checking if my cleanup function was working, I noticed that I could use allocated dat...
[11 replies] Last: So you say that I should never check if malloc failed because I shoul... (by chrisname)
operator overloading (1,2)
 
Hi, I am writing a "vector" class. I know about the STL but I prefer to use this as I use this to c...
[25 replies] Last: sure, thank you very much once again. (by pozdrav)
breaking a 1D array into a 2D one
 
I've been struggling with this function for quite a while and it's starting to drive me insane, So I...
[2 replies] Last: thanks, yea thats what i meant on line 18...it's been 12 hours of star... (by Seraphimsan)
by diod31
ifstream syntax error in a class template constructor
 
These are my errors: line, error, default order, which file the error is in 16 error C2061: syntax...
[1 reply] : Templates don't work that way. The most common use of templates is ... (by helios)
ifstream problem
 
This program is supposed to have user input name of imputfile,open the file which should contain a l...
[5 replies] Last: .data() doesn't necessarily give you the null (which you typically nee... (by Disch)
Linking Error 2019
 
I am getting this error message when I compile my code. Build Output Message: 1>------ ...
[7 replies] Last: I was able to resolve my problem. I had created the code as a WIN32 P... (by tepeyton)
Files trouble
 
I have some code that opens a file using a fuction to request the file name i then request and id th...
[5 replies] Last: yes i open the file to read it then the user inputs a number to look f... (by smeghead)
Need answer by tonight! Switch Statement CAN NOT have breaks!
 
I'm needing to write a program that gives the user a menu to choose from. He or she enters a letter...
[12 replies] Last: Fixed everything. Thank you all so much, you all are god sends. (by GrayKitten)
by Zap
output spacing
 
As a project for school I am doing a simple fraction calculater. However, I have decided to go a lit...
[3 replies] Last: i have sort of come up with a solution. all i need is the syntax to fi... (by Zap)
by Disch
looking for design feedback: string class "substring"
 
So I'm working on a series of string classes which work with UTF encoded strings. I'm not working...
[2 replies] Last: I suppose it could if I really wanted to do that, but I'm not so sure ... (by Disch)
Read different types from a getline string
 
Hi all, What is the best way of reading in a line at a time from a file, and extracting a char fo...
[1 reply] : You'd probably be fine with extracting the char, then each number stra... (by tummychow)
Memory Allocation
 
Does the memory allocated by the new keyword in a function body get deallocated when the function ...
[1 reply] : Barring the use of auto/smart pointers, you need to associate every ca... (by closed account 1yR4jE8b)
[C] Pointer member in structure confusion
 
Hi, I have a typedef'd struct with a pointer member: typedef struct { int *i; } TEMP; ...
[10 replies] Last: Based on the code and thread title I assumed he was coding C. (by Disch)
file trouble
 
im having trouble opening a file,and checking to see if it was opend correctly..the user is supposde...
[6 replies] Last: I think that, for a relative path, you need \input1.txt, not just inpu... (by tummychow)
Reference and classes
 
Hi everybody, I just started programming with classes. Everything was fine until when I saw this e...
[4 replies] Last: Oh, I see...basically I always thought to * and & as referring to a va... (by andrew12345)
by jhapk
Not repeating the same operation
 
Hi, in a few functions I am doing the same operation, multiplying two static variables every tim...
[2 replies] Last: Hi Disch, the value of alpha and beta remains constant for all Func... (by jhapk)
Char problems
 
I'm working on some data structures in C++ and I'm having trouble understanding some problems with t...
[2 replies] Last: Most compilers do not allow variable length arrays because it is non-s... (by jsmith)
How can I call Constant Functions?
 
Hello All; I have two files: 1. ConstantConcept.cpp 2. ConstantConcept.h 1. ConstantConcept...
[5 replies] Last: Additionally, the get_name method could be more suitably named set_nam... (by moorecm)
March 2010 Pages: 1... 1718192021... 23
  Archived months: [feb2010] [apr2010]

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