General C++ Programming - April 2009

by yygyt
Updating a File
 
Hello, I was trying to update the data in a file for a dbms. Anyway, at some point, I had to change some content, say number of users, without changing anyth...
[1 reply] : Read the file to memory, modify, write back. If the files are too big... (by helios)
Overload operator << for a template-nested private class
 
I get this error: error C2785: 'std::ostream &operator <<(std::ostream &,const Outsider<T>::Nested &)' and '<Unknown>' have different return types W...
[4 replies] Last: Just move the implementations of the operator<< into the class at the ... (by jsmith)
NO File, but still a buffer... how?
 
OK, my challenge is basically this - read a file from a SCSI device through the device manufacturers .dll (got that part, I think - using malloc into a byte arr...
[1 reply] : http://www.cplusplus.com/reference/iostream/istream/read/ Also, you... (by helios)
calling member functions on a boost::lambda pointer
 
Hi! I am trying to use lambda to this use: std::for_each( paBOBhErfolgAbgrenzung->begin(), paBOBhErfolgAbgrenzung->end(), _1->coutData()); where paBOBh...
[1 reply] : boost::bind( &YourObjectType::coutData, _1 ) will do the trick. ... (by jsmith)
Bin file io
 
so im working on this little file io project of mine and i made this: #include <iostream> #include <string> #include <fstream> #include "Queue.h" #incl...
[11 replies] Last: An array declared as array has 9 elements: [0..8]. (by helios)
Can't call OpenThread
 
Although i included windows.h in my project, i can call to OpenThread API. It said 'undeclared identifier'. I'm a bit mad mow, please help me.
[1 reply] : msdn says this: Minimum supported client Windows 2000 Professional ... (by writetonsharma)
by Incan
fstream, two dimensional arrays and spaces
 
Hello, I'm trying to get fstream to send words seperated by spaces (or tabs) into a two dimensional array (ie: one dimension for the word itself, one for distin...
[1 reply] : int main() { char chaine ; ifstream entree("dico.txt"); int i=0... (by writetonsharma)
Templates
 
Is it possible to put a class/function template definition in a header file and then include the file in the cpp files that use the template?
[3 replies] Last: OK, thanks :) (by Tom Backton)
Const functions and "using" classes
 
I have two unrelated questions: 1. Where do I put the const, in the declaration int MemberFunc() const; ) or in the definition int MyClass::MemberFunc(...
[8 replies] Last: You didn't answer the question about const (the answer is: both, decla... (by Tom Backton)
by wretch
almost identical derived class function signatures
 
This problem has come up for me in slightly more complicated form, I have created a contrived example to shorten the code. For a given base class, if all der...
[4 replies] Last: -- but once you have a good design, the programming part is soooooo e... (by wretch)
File I/O problems?
 
Hi, I'm trying to make a program to create, edit and delete text using a .txt format and the users default text editor. I want the user to be able to create a ...
[2 replies] Last: http://www.cplusplus.com/reference/clibrary/cstdio/remove/ (by Duthomhas)
Dynamic Stack Template
 
I have the following at this point: DynStack.h // Specification file for the DynIntStack class #ifndef DYNSTACK_H #define DYNSTACK_H template < clas...
[2 replies] Last: That did the trick. Thanks (by Return 0)
array compress
 
i need to do something like dirs in the pc. like C:\System\etc. using arrays or something else. thinked about: char ref ;//just the elements char ...
[4 replies] Last: Really thanks! (by chibolete)
by lotios
Passing a user supplied variable to a function
 
It is my first time posting here, so please bear with me. I have been trying to make a simple text-editor using the Command prompt. It glitches at line 15. The ...
[12 replies] Last: It still doesn't do what I want. Oh well, of to classes. (by lotios)
by vRltwE
Define a 3 dimensions vector
 
Hi, to create a matrix I do; vector<vector<double> > matrix( cols , vector<double>( lines ) ); Now I need to create a 3 dimensional vector, I tri...
[1 reply] : vector<vector<double> /* missing '>' here*/( lines )) But I'm not s... (by helios)
All confused.
 
Ok , i just installed Visual Studio 2008. As i followed through some tutorials on how to write a console applications , i did the same. File --> New Project...
[8 replies] Last: Hey! Kbw , well , thanks for the prompt reply. But since many days i w... (by noobers)
singleton pattern basics, private static data member definition
 
This simple code should compile and link according to the gang-of-four and websites: class X { static int i; }; int X::i = 0; // definition outsid...
[2 replies] Last: Starting a new project and having the Console program setting helped. ... (by strawberry)
randomizing
 
i have this code where i have to sort a random array into different sorts. the code being: #include<iostream> #include<iomanip> #include<cstdlib> using ...
[3 replies] Last: I'd have the functions take a pointer to the array. It's a bit easier ... (by closed account S6k9GNh0)
Threading error/questions
 
I'm trying to multi-thread a program i'm writing so it can accept user input while running a timer (so that if the user doesn't enter anything within a given ti...
[16 replies] Last: I tried Sleep(DWORD) and i get an error: expecting parameter before ) ... (by aeronet)
console syntax
 
i have this code with me and i just typed it down in normal c++ syntax, well most of it.. and i want to convert it into the console syntax.. i dont have the sof...
[9 replies] Last: im sorry everyone.. didn't mean to sound as rude as i did...the work-l... (by hugsnbugs)
April 2009 Pages: 123... 20
  Archived months: [mar2009] [may2009]

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