General C++ Programming - May 2009 (Page 11)

by nanger
how to call a program in another main() function
 
I wrote a program (sim) where there is main(int argc,char *argv ){} this program could be executed by command line like: sim 3 and I want to execute this...
[6 replies] Last: thanks! (by nanger)
by dkaip
a unique number for a word
 
Hello all. I am trying to take a unique value for a wide string, with the function. long int UniqueCode(wchar_t* ch) { long power=127.0; long int...
[7 replies] Last: It is a very complicate project, and i think i am finish, and without ... (by dkaip)
Allocating file memory in a multiple inheritence construct
 
Sorry for posting again so quickly. I am having some trouble with my constructor, basically I need to use the values I receive in my constructor and instanti...
[9 replies] Last: It is (safe and valid) in all existing implementations of the STL. ... (by Duthomhas)
by pass
C++ Cosine? radian?
 
Please, I don't get this I did some base functions, but my math equation gives wrong answer. what equation (in code) needs to get the right answer! please help ...
[10 replies] Last: Sorry, I was half asleep and I didn't look at the formula he was using... (by Duthomhas)
Is it better to pass STL container classes by value or by reference?
 
Which is standard? Would it be better to pass something like a vector by value like the built in types or by reference more like the object types?
[3 replies] Last: But passing STL containers, no matter what they are or how many elemen... (by jsmith)
Convert int to a string binary..
 
This code takes in any in..convert to binary and reverse it in string.. forms a 8 bit binary string.enjoy~ string binary(int K) { string fBin = ""...
[19 replies] Last: True, though the construction of the string requires a memory allocati... (by jsmith)
Getting last element from vector
 
link_Node *pNode,*tempsegnode;; // here link_node is a class vector<link_Node*> *pList; pNode = (*pList) ; i want to find that a pNode is last i...
[1 reply] : std::vector::back() (by helios)
Problem with functions
 
Well. I'm trying to create a program in which a user can pick how many will be playing, ask for each players name ask each user how many tickets to pick, then h...
[2 replies] Last: This is a duplicate post (by buffbill)
Problem with functions
 
Hi I made this program, and i was having trouble dividing it into 2 functions. One called user_input(), and the other one user_output(). Can anyone help ...
[2 replies] Last: Line 17 to 27 is input and line 28 to 34 is output but as Hammurabi sa... (by buffbill)
Parent Function?
 
Hi, I'm new to C++ and I'm finding this site extremely helpful! I've now figured out how to reference functions from inherited classes, but now I have a simila...
[7 replies] Last: So give a pointer to the B object instead of an individual value. A... (by Disch)
fstream base class not found
 
Hey, I'm using multiple inheritance to derive a class. The derived class is created from one of my own classes and the ifstream class. The only problem is t...
[2 replies] Last: Yea but need to do this for an assignment. I did figure it out, I was ... (by kenshin)
Implicit parameter declaration question
 
I have function which takes void setthis(string &name); On windows with nmake compilation setthis(string("henry")) --->works On Linux setthis(string("h...
[7 replies] Last: thank you (by angelwarrior)
Initializing a struct to zeroes
 
I know you can initialize an array to all zeroes like so: int a = { 0 }; And, as another example, this would initialize the first element to 1 and the ...
[4 replies] Last: It seems to work. #include <iostream> #include <vector> stru... (by Hammurabi)
by dkaip
trying to extract from wide char
 
Hello all. I am trying to extract from ch1 the 7990. Comparing strings are the same, but ch gives 7990, but ch1 not. How is that? (windows xp Greek version an...
[5 replies] Last: I think i found ... wchar_t *asd=UTF8_to_WChar("ἶ"); cout << as... (by dkaip)
Overriding Question
 
Hi, I'm new to C++ and actually used the tutorial here to learn it. I'm wondering if there is a way to call a function in it's pre-overridden form after it is...
[6 replies] Last: you are correct. My mistake! *edits* (by Disch)
by MrCode
GLUT program does nothing...?
 
I'm trying to follow a GLUT tutorial that I found at the following site: http://www.lighthouse3d.com/opengl/glut/index.php?1 I can get the first example p...
[3 replies] Last: It's been a while since I've played with GLUT, so I forgot -- yes, you... (by Duthomhas)
Problems with lvalue?
 
If the object is returned by value as a const ,then the result cannot be modified as an lvalue?? Wat does this mean??
[1 reply] : Consider this statement a = 4; a is the left value, and 4 is the... (by kbw)
text file from Visual Studio 2008
 
Is there a way to create a text file from within visual studio 2008 for use as an input file? Or do I have to use something else like notepad? Thanks, Beth
[5 replies] Last: guestgulkan - yes I'm sure. helios - Thanks for the answer. T... (by elabelle)
by ilyes
bit field
 
hi, i would like to ask about bits fields is it a standard?? and why not is it not portable??? thanks!
[7 replies] Last: http://www.google.com.ar/search?q=bit+fields+portability (by helios)
Calling same function with different number of parameters
 
HI I want to call same function with different number of parameters. i know we can call same method with diffrent type of parameters but i need with differen...
[4 replies] Last: two options: 1) use a default parameter void myfunction(int ... (by Disch)
May 2009 Pages: 1... 910111213... 17
  Archived months: [apr2009] [jun2009]

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