General C++ Programming - June 2010 (Page 10)

Reading from a file to an array ..
 
Hi I am trying to use a code that reads coordinates from a text file in an array and passes three coordinates to a function in opengl. Well opengl is not my top...
[8 replies] Last: Hi Galik .. your trick worked fine !! Now I tried using Sleep() for ... (by rhtbapat)
Evaluation d'une expression char* ou string
 
Je suis appelé à faire un tableur dont chaque cellule contient une formule de type string ou char*,où les seuls opérateurs trouvés sont + - * / ( ) [ ]. Ex...
[2 replies] Last: Pose ta question en anglais et montre-nous ce que tu as fait. (by m4ster r0shi)
Default constructor invocation
 
I will appreciate if someone explains: * why is this wrong: ObjectType var(); // error while these are right: ObjectType var; // ok ObjectType var = O...
[15 replies] Last: Because the grammar of your error line above is: <type> <identifier... (by jsmith)
how to select variables efficiently?
 
hej! i have to following problem and would like to know, if anyone can think of a more efficitent way to solve it. the rough idea is, that in the end the user o...
[3 replies] Last: Hopefully the actual program is a little more complicated than the exa... (by jsmith)
by Cshark
Pointer Question with delete
 
Hey i have a question regarding pointers i have a class class MyClass { ... }; MyClass *c = {NULL}; for( int i=0; i<50; i++ ) c = new MyCl...
[2 replies] Last: thanks =D (by Cshark)
inherited method was not declared in this scope
 
I have run into a compilation problem that I cannot figure out, and google hasn't helped me either. I looked at the output of g++ -E. It didn't enlighten me, b...
[2 replies] Last: Firedraco, thanks for the help! I now have class linearMotion: pr... (by mpictor)
Timer in milliseconds
 
Hello, I want to create a timer which ticks after I run my program. this timer should call one of my functions in 10 or 100 milliseconds. I have some info ...
[6 replies] Last: yes, the linker cannot find the library. if it's not in a standard pl... (by bigearsbilly)
Overriding + varying default argument presence
 
I can variate argument default value presence from base to derivative and have correctly usabe, overriding functions (virtual). But should it always work? ...
[1 reply] : Thats because, the virutal table does not maintain information about t... (by karthick88)
by everid
how to get type information in C++
 
Hi Masters: i have a question about how does compiler know the type information. e.g. class A{}; A* p; when we need to dereference p, or such like ++p, t...
[2 replies] Last: What the compiler 'sees'and what the compiler 'generates' are very dif... (by Galik)
"Expression must have a class type" error
 
Hello! I am new to this forum. I am looking for some help. I am VERY new to C++ and am not too sure what the error I am getting means. The code I have in my...
[1 reply] : Line 27: Reactions is an array of ints, but you're using element i as ... (by helios)
Class T function is giving me errors .
 
Hello guys, I have the following problem in my class vector i have this function: vector<T> plus(vector<T>&); which is initialized as followed: template ...
[8 replies] Last: ok i got it working , i was not suppse to use this. Thanks alot (by aymank1985)
by korg
STL (1,2)
 
Hi, I had some queries regarding STL. I 1)Is it possible to compare two containers which are different types? i.e a Vector and set ? 2) If i were to co...
[22 replies] Last: I think you also need to make both your operator()() const and the "in... (by jsmith)
operator Overload Getting weired error
 
In my class i have : friend ostream& operator<<(ostream& output,vector<T>& ); this function was declared as following: ostream& operator<<(ostream& output,...
[10 replies] Last: Please read this: http://www.parashift.com/c++-faq-lite/templates.h... (by korg)
Parsing a .dat file to text file
 
I need to parse a .dat file which contains contains few information as path of a file,filename,date of creation of file etc. These information are stored as h...
[1 reply] : What is the header file? (by Galik)
C++ learning and books
 
Well, I was using C++ for years, but just lately start looking for "all" of its features and how to use them. Knowing every possible thing about C++ is not my g...
[4 replies] Last: The standard library (and STL by extension) is an integral and basic p... (by Athar)
Tile based Array 2d game
 
This is the first time I have tried making a tile based array for a game and I'm getting a few errors I don't know how to fix. I also don't know if I did the cl...
[5 replies] Last: Yeah, I know. When you post code put it inside code tags, like this: ... (by m4ster r0shi)
How do make a program to find the annual after-tax?
 
This is what I have to do and this is what I have so far, but it just finds the interest. How do I find the annual after-tax? Write a program that computes t...
[1 reply] : So whats your problem? Write a new function to do the simple math. (by siavoshkc)
I have some question about C++
 
It' not homework...Sorry if I made it sound like that... Can a void function return any value? Can a void function not be used in an output statement? ...
[6 replies] Last: Can a void function return any value? Try compiling this : voi... (by korg)
calling C++ function pointer from C context
 
Is there any way to call a C++ function pointer from a pure C function?
[1 reply] : If it's not a class member or is a static member it's just the naming ... (by kbw)
include vs import
 
what's the difference if any between these two? I mostly see import but I've seen some include. Thanks
[2 replies] Last: #import is Objective-C, not C++ nor C In Obj-C #import ing is equiva... (by Bazzy)
June 2010 Pages: 1... 89101112... 18
  Archived months: [may2010] [jul2010]

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