General C++ Programming - February 2011 (Page 3)

by baluba
wxString and normal ANSI strings: How to copy?
 
Hi all. I have the following script: char string1 ; wxString string2; strcpy(string1, "Hello"); Now: copy string1 into string2 ... ...
[11 replies] Last: Uuups, this was a typing error. I corrected it: char string... (by baluba)
by frabar
Class Array
 
How would I go about making a class that is an array, sort of like a vector? Basically, I want it to have members like "MyClass.Add(Params)" to increase the ...
[6 replies] Last: Hm. Now I'm getting back to the original issue. Here's the function... (by frabar)
Classes and overloading!
 
I have a C++ issue with Classes and Overloading Functions that Im having difficulty with! The instructions says, Create a class named Dog with a string fiel...
[7 replies] Last: Honestly I cant thank you enough... This is really so much simpler the... (by corseting)
by Sieves
console stops responding
 
I'm not sure if this is a problem with my code or with my computer... int main(){ ifstream infile; ofstream outfile; string words ; //this is the a...
[3 replies] Last: Are you sure that this nested loop is nested in the right order?? ... (by guestgulkan)
by Sieves
last problem
 
I have almost everything done but these two modules are interacting incorrectly. What happens is it fills the grid with A random letter. its like it only calls ...
[4 replies] Last: i think the define of r & c is missing inside CompletePuzzle() functio... (by necsky)
How exactly to audio libraries work in C++?
 
I couldn't figure out exactly how to word it in a google search, so I just thought I would ask here. How does it play a sound, decode it, everything. Well, not ...
[3 replies] Last: Great description, Disch! Thanks for the information! (by TheOtherIsland)
by Sieves
random number generation
 
I am still working on my word search generator so this pertains to that if you are savvy on my current project. i am at the point where i need to fill in the...
[3 replies] Last: It does work... is it because you are adding the 'A' ascii number to t... (by Sieves)
by raydan
passing one argument to va_list function
 
bool somefunc(void *in1, void *in2, ...) { va_list arg; va_start(arg, in2); ... va_end(arg); return true; } // #1 somefunc(NULL, NULL, 1...
[6 replies] Last: It just occurred to me that you could do something like: bool somefu... (by simeonz)
Classes
 
I'm having two errors and i don't know why? Please some help will be appreciated. Thanks Here's my code.. // This program uses a class to compute the inve...
[4 replies] Last: Thanks for help... that was it!!!! (by lenovo09)
basic artificial inteligence (game bots)??
 
I am making a rotational space shooter that involves two human players flying around in an infinite 2d world shooting up enemy space ships (bots). I will have 2...
[10 replies] Last: The problem was that dy/dx is a truncated integer division. Once you ... (by Bazzy)
empty class
 
Hi , Can some one tell me what are the default complier function called for the empty class ? class A { }; void main() { A a ; } Thanks in ad...
[5 replies] Last: thanks jsmith this is what i want . thanks for the help . (by bluecoder)
by baluba
Identifying files if they are Windows Mac or Linux
 
Hello. How can I identify a file if it is a Windows, Mac or Linux/Unix file? If possible, I would like to use normal ANSI C. Thanks for some comments.
[15 replies] Last: > You've written it to convert EOL sequences to Windows' default. But ... (by baluba)
Global variables in classes
 
Hi, I'm currently making a program,which is taking a global variable maxKoeLaengde and uses it in the constructor (this will be a constant defined before com...
[1 reply] : My guess is that you want something like this: class Lifokoe { p... (by m4ster r0shi)
by fafner
Limited inheritance
 
This is just a thought. Say I have a class Foo, and a class Child that inherits Foo. Is it possible to declare a function in Foo that Child does not inherit wit...
[2 replies] Last: Wow, thanks! I'll read up on the Liskov Substitution Principle;) (by fafner)
by baluba
In ANSI C: How can I find out the operating system?
 
How can I find out which operating system is used? - I have the same C code for a Windows and Linux computer and need this information during running the code. ...
[5 replies] Last: There is no win32 . It's _WIN32 . (by kbw)
by v8n3t
Abstraction and Polymorphism, question.
 
Hello everyone, I am working on a project for school and had a general question. I researched the error I am getting upon compilation and found out the reaso...
[2 replies] Last: cbeginplusplus, Thank you for your response. After looking at your ... (by v8n3t)
STL queue?
 
Hi! I am wondering how to access the different elements held within a queue. For example, in the following code I use push to fill the queue with 4 vectors, the...
[4 replies] Last: Is it possible to nest STL containers? For example, can you create a ... (by simeonz)
Why does this go into an infinite loop?
 
I wrote the quick sort function but when I run it it doesn't exit the loop and I don't know where the problem is at. Any help would be greatly appreciated. q...
[7 replies] Last: cbeginplusplus is right. I actually had recoded the whole thing and en... (by simeonz)
prevent user from inputing duplicate stings into a vector
 
I am trying to write a program for a game list. I have it all done but I can't get it to prevent users from entering duplicate information. here is my code: ...
[3 replies] Last: I am kinda new to c++ could you give me a little example i know about... (by sabersimon)
assistance with bool loop.
 
i have to write a bool function that checks the numerator to make sure its not a 0 and the symbol to make sure its a slash. if the conditions are met, the func...
[1 reply] : Do you mean denominator != 0 to prevent division by zero ? How abou... (by closed account D80DSL3A)
February 2011 Pages: 12345... 25
  Archived months: [jan2011] [mar2011]

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