General C++ Programming - January 2009 (Page 4)

constructor doubt
 
a question, please help me answer 1)Consider a single inheritance where class D inherits from class B. Now when i create an object of class D in main(), constr...
[2 replies] Last: The construction order is done that way because typically your parent ... (by Zaita)
Alternate TAB/SPACE Printing for Vector
 
Dear all, I have vectors which content is multiply of 4. For example this (surely the actual vector size is much larger than this). [40,10,30,-1, 20,...
[2 replies] Last: for (int i = 0; i < vector.size(); ++i) { cout << vector << " ";... (by Zaita)
converting method from java to c++
 
I am not very well versed in c++. I need a little bit of help with some code in converting a simple method in java to c++. In java I would write this: ...
[2 replies] Last: At first glance, I'd say that Java function was poorly written to beg... (by Zaita)
by dietzi
alignment of different data types ???
 
hi all, I do have troubles with the alignment of data which I read from a file. The data in the file are: aaaa bbbb bbbb cccc cccc dddd dddd ... I tried ...
[3 replies] Last: Well, I would do it like this: xy::xy(uchar *data,ulong *offset){ ... (by helios)
When is a static function-scope object destroyed?
 
Hi all, I'm trying to find some reference material for the destruction of a function-scope object. I am able to find a lot of material about static class me...
[4 replies] Last: Thanks helios (by JivanAmara)
by dkaip
wchar_t and reading unicode strings
 
Hello. I am a newbie in c++. I've a txt file with ancient chars, utf-8 format, and must be open all words in string that keep Unicode chars for working. I am t...
[11 replies] Last: It works just fine. I just try the strtok but there is not on codeb... (by dkaip)
Avoid including a library twice
 
Hi all, My problem is that I have a main file which includes "file1.h" and "file2.h" and both of them include another "file3.h". That causes a problem of redef...
[2 replies] Last: Oh, I understood! Now it seems obvious! I though that by some conventi... (by kunigami)
Basic in Pointers
 
hi, i am new to programming.. i have a code.. #include <iostream> using namespace std; int main() { int x,y,*p1,*p2; p1 = &x; p2 = &...
[4 replies] Last: Hi Scipio, thanks for the links...i will look into it... (by littleson)
What is the c++ code for recognizing a valid c++ identifier?
 
What is the c++ code for recognizing a valid c++ identifier? there are some conditions to be followed: 1. it should start with a letter or an underscore 2. no...
[1 reply] : 1. it should start with a letter or an underscore 2. no two succeedi... (by helios)
by PhDP
Matrices
 
For a math project I want to create a class to deal with matrices (two-dimensional arrays). I want to write my own class, I want it to be fast, and I don't need...
[4 replies] Last: For the speed it doesnt matter at all. (by Scipio)
Reading and Replacing a String in a Buffer
 
Hello all, I am trying to replace a string in a buffer. I have code that will replace the string I'm looking for once. However, I need it to to replace every...
[14 replies] Last: Nevermind, I figured it out. (by workboy)
Compressing String and Manipulating It
 
Dear All, I have a C++ code that prints such output. AAAAA 00000 0.00264776 0.00264776 0.00264776 Now the output is very2 large with millions of...
[1 reply] : http://www.cplusplus.com/doc/tutorial/files.html >>Binary file (scrol... (by Scipio)
Printing 100 factorial
 
Printing 100 factorial using C++ sounds to be easy. But please note that it is not capable of storing the no. of digits 100! contains. (LONG DOUBLE MAY STORE ON...
[4 replies] Last: A vector would take care of the dynamic memory allocation without havi... (by egregory314)
Simple Getopt Problem (newbie question)
 
Dear all, I have the following simple code that uses Getopt. #include <unistd.h> using namespace std; int main (int argc, char* argv ) { ...
[1 reply] : I never herd of getopt before your post, but I went to http://www.gnu.... (by egregory314)
connecting to another computer through LAN
 
Hey, how would your connect to an application on another computer through the LAN using c++? muchas gracias
[2 replies] Last: sw33t tanks (by splatbert)
Array values passed from external function
 
Hello all, I have run into a problem I can't find a solution to. I pass an array from IDL (a programming application like Matlab). The array is passed by refe...
[1 reply] : More info is needed especially about the architecture of your program,... (by anders43)
by jrohde
An if-statement performance question
 
Hello all, Let's say I've got the following statement: if (number > 10.0 && number < 5.0) do_something(); Then would I lose or gain performan...
[2 replies] Last: most compilers optimize it anyways so the main objective for you as a ... (by anders43)
Data Type Problem with Different GCC version
 
Dear all, I have the following code, that uses some arithmetic in 'id2tagnum' function: #include <iostream> #include <string> #include <stdio.h> ...
[3 replies] Last: Safer is to use boost::numeric_cast<>: int fm = boost::numeric_c... (by jsmith)
How to pass into a macro different functions with different parameres.
 
I have a piece of identical code that need to be executed in several places of a program. The only difficulty is that within this code I need to call different ...
[9 replies] Last: What you are trying to do sounds suspect to me. You should re-think ho... (by Duthomhas)
by masiht
problem in a program
 
// my first program in C++ #include <iostream> using namespace std; int main () { cout << "Hello World!"; return 0; } this program is not showing ...
[7 replies] Last: Read the link that Helios posted!!! (by closed account z05DSL3A)
January 2009 Pages: 123456... 11
  Archived months: [dec2008] [feb2009]

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