General C++ Programming - August 2010 (Page 11)

Singleton class with static method
 
Hi I am trying to implement singleton class having static method. my requirement is as below: A.h Class A{ Public : Static A* getInstance(); } B.cpp...
[8 replies] Last: Related thread: http://www.cplusplus.com/forum/general/26976/ (by moorecm)
by Isuju
Media effects in C++
 
I've been searching all over the internet for tutorials of any kind on manipulating media in C++ and haven't found anything like what I'm hoping for. I'm tryin...
[1 reply] : http://sites.google.com/site/webcamopencv/ (by blackcoder41)
by JRevor
Division by zero.
 
Hello. I'm programming a couple of simple linear algebra tools, and was wondering how could i get to handle the division by zero within my own program. I want t...
[2 replies] Last: Thanks! (by JRevor)
by ibtkm
pointers
 
hi every body. i have one fundamental question in this code : const char* a = {"ab","bc"}; "a" array is a array of pointers but why we get it "ab" and "...
[3 replies] Last: well your are confusing yourself with array of pointers. names is arr... (by rahulroot)
How do I pass non-english characters from char* to whcar_t* on English OS
 
Code Snippet: Collapse int Convertchar_wchar(char* pData, int pDataLength) { wchar_t wcsQuery[4096*2 + 2]; memcpy((void*)wcsQuery, pData, pD...
[1 reply] : memcpy() copies raw bytes; it doesn't have any type awareness. If you ... (by helios)
Efficient Class Initialization
 
Let's say there's a class with 200 variable members that are not in an array. They are mixed types of char, short, int, and so on. I want to initialize them all...
[17 replies] Last: Yes, it's dangerous. I've already realize this point, especially in cl... (by Vegertar)
callback functions
 
In C/C++ can a called function have an ability to know the name of the calling function? May be, by accessing the stack or any other way? Please note that th...
[2 replies] Last: Not portably. It can be done using [system [debugging features]] to ge... (by helios)
Speech/Object Recognition (1,2)
 
I was wondering how to make your own speech and object recognition. I've been working on this project and it uses both of them. Sorry for vagueness but I don'...
[22 replies] Last: My gmail account is dtechnodude@gmail.com (by D Technodude)
How to fix the given compilation issue with VS2010?
 
I am facing issues with a project called ServiceConfigurationManager in Visual Studio 2010. The project compiles without a hitch in Visual Studio 2005, it also ...
[2 replies] Last: @guestgulkan: Thanks a lot. Your suggestion fixed the problem. I previ... (by merwanhade)
File Creation Location Trouble
 
I made a file and tried to change it but the program made another file instead. I was wondering how to specify the file path, or even if there is a way.
[6 replies] Last: THANK YOU SO MUCH!!!!!!!!!!!!!! (by D Technodude)
Self aware objects in templates
 
Hi, I am trying to create a powerset template which permits both the input set (in the mathematical sense except that duplicate members are permitted) and ou...
[2 replies] Last: An interface consisting of iterators is more flexible than an interfac... (by jsmith)
by deems
GUI programming - frameworks
 
I have been looking into the Qt4 framework or GTK+ for developing GUIs. Anyone have any positive or negative experiences with either framework they would lik...
[no replies]
Input using data already output on the screen?
 
How can I input something that is already output on the console screen. For example, if the code is: cout << 2 + 2 << endl; the console screen will show: ...
[1 reply] : You cannot read what is on the screen. At least one cannot do this in... (by PanGalactic)
by eye51
passing vector : reference or value?
 
Hi, I have this: I want to pass a vector of Base class, to MyClass and in MyClass resize and use further. class Base { public: ..... ......
[6 replies] Last: I'm coming in without reading any of the above but Disch wrote a nic... (by mcleano)
SDL+OpenGL objects don't render if z axis isn't 0.
 
So I have this, medium sized code chunk, as a part of a game I'm starting to make: #include <SDL.h> #include <SDL_net.h> #include <SDL_opengl.h> #include...
[1 reply] : And here's the draw cube function: int drawcube(float x,float y,fl... (by Syerjchep)
by Null
Variadic functions
 
How can I use functions from cstdarg header in this situation? void x(...) { // ? } int main() { x(11,12,13); } I know that it should be void ...
[4 replies] Last: OK, thanks. (by Null)
Problem with dates!!
 
Hi all, For a portion of my code, I need to either input a date from user or capture the system date. From there onwards I have to add 7 more days to the ac...
[4 replies] Last: for 1. I can use setfill(). yipee! :) could u still suggest a meth... (by cyberbeast)
Comparison of 3 variables @ a time
 
Can v compare 3 variables @ d same time without using logical operators ? Like..., if(a==b==c) { cout<<"equal"; }
[1 reply] : nope, that would be equivalent to ( a == b ) == c a == b will re... (by Bazzy)
Arrays
 
I was wondering how to make it so the user enters text and the computer enters that into an array. Something like this: string word ; cout << "Enter \"Hel...
[4 replies] Last: THANK YOU!!! (by D Technodude)
Print number in diagonal format in matrix
 
Hi. I tried to print number in matrix in following format but could not reach the solution .. does anyone have idea Ex. I have matrix a 3] = { 1 ,...
[2 replies] Last: sorry it is only me ... i think by mistake it pasted twice on this for... (by agoswami)
August 2010 Pages: 1... 910111213... 20
  Archived months: [jul2010] [sep2010]

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