General C++ Programming - August 2012 (Page 18)

How to represent a DEC Single Precision Floating Point(DEC SPFP) Data Type
 
Hey, I am working on a project where I need to format messages to send to a GPS receiver but some of the data types in the messages are DEC Single Precision Fl...
[2 replies] Last: tnjgraham I am working on this now and was wondering if you ever figu... (by bigrediam)
by RyanM
Copying Strings
 
I have 3 questions here on the same topic. 1) Why can't I do the following? int main() { char a = "hello"; char b = a; } Please understand I am not askin...
[14 replies] Last: Is this loop that copies the data to the stack executed at run time o... (by Cubbi)
'string' does not name a type
 
#ifndef ADD_H_ #define ADD_H_ #include <string.h> int add(int, int); string cat(int, int); #endif /* ADD_H_ */ when i compile the code I get the f...
[2 replies] Last: thnx, it worked now with above modifications. (by mnasiriqbal)
Unresolved External in VC++ MFC ActiveX Control
 
Hi All, I want to create mfc activex in vc++, I use cvBlob in my project in OpenCV 2.1 in Visual Studio 2008, I copied all source files in my project ...
[1 reply] : The linker cannot find the functions mentioned in the libraries you ha... (by Moschops)
Factory Method undefined reference
 
Hey guys, I'm a complete noob with regards to Design Patterns and classes in c++, just looking for some advice. I keep getting these errors: MedicFactor...
[3 replies] Last: Did you ever get that silly idea to write some code into your function... (by viliml)
by viliml
declaration in .h and implementation in .cpp?
 
Many times I saw people define their classes and function prototypes in the .h file, and then implement them in the .cpp file, but never #include the .cpp file....
[9 replies] Last: Ooooh you have to include it in a project! (by viliml)
My class program, need help please
 
#include <iostream> #include <string> #include <stdlib.h> #include <iomanip> using namespace std; const double MIN_SALARY = 50000; const double MAX...
[7 replies] Last: Some more thoughts: If you are settings variables when the object is ... (by TheIdeasMan)
Threading issues... (1,2)
 
So I have this piece of code: #include "Game.hpp" // ctor/dtor // ... void Game::Run() { sf::Event Event; while(Window->isOpen()) { Sta...
[22 replies] Last: I managed to make it not crash by giving WorldSession a copy of Game p... (by closed account 10oTURfi)
std::vector<> as function parameter
 
Is it a good practice to use vector<double> as function parameter instead of double*? Or as a return type of function?
[4 replies] Last: Basically what everyone is saying: If you want to use a sequence of do... (by Script Coder)
SFML audio streaming issues
 
I am trying to use SFML to load sounds. I got basic sounds to work, but longer audio files don't work. The tutorial told me to use audio streams. This is the co...
[1 reply] : I just tried this: sf::Music Music1; if (!Music1.OpenFromFile("Mu... (by DeadEli)
by cniper
counting number of lines in a given file
 
i am suppose to write a program where it asks a user to input a text file location and then counts the number of lines in this file. output may look as: enter...
[2 replies] Last: this will probably help: // // #include <vector> #include <string... (by jmadsen)
Inhertiance from classes defined in other files
 
So I have this class client that is defined in client.cpp, and I have another class player, which inherits all of clients classes. The problem, is that when I t...
[10 replies] Last: class B; class A { B *b; }; class B : A { }; Compiles for ... (by closed account o1vk4iN6)
Unknown errors when I exit program
 
Hi all, I get the following errors and I do not know or understand why, or how to correct it. // ============ This is line 13 in code ===================...
[3 replies] Last: I expect your IDE has a big "run debug" button somewhere near the top. (by Moschops)
gravity simulator
 
Hey guys, I am trying to write a gravity simulator in c++ and sdl. Can anyone, who knows physics, help me with the main code. I am doing this mostly from me...
[6 replies] Last: Heya, I decided to start with a simpler program. This one allows the ... (by closed account zwA4jE8b)
L-VALUE POINTER FUNCTION
 
hi guys , I have strange question , that why the pointer function member is l-value like #include <iostream> using namespace std; class time{ privat...
[3 replies] Last: You will need to read up on Rvalues and Lvalues (which will not be eas... (by guestgulkan)
by LB
Can't specialize template?
 
template<typename T> void f(const T &t) { } template<> void f<char *>(const char *cstr) //error: does not match any template declaration { } This is a new one ...
[6 replies] Last: Huh, I thought I tried that once and it didn't work and I asked about ... (by LB)
Problems with Template method
 
Hey guys, I am new to classes in c++ and am getting this error whenever I compile my code, and it's driving me mad. Error: Main.cpp:(.text+0xe5): undefi...
[2 replies] Last: I did but whenever i tried it threw errors back in my face. I am unsur... (by theCount)
wxDirPickerCtrl
 
Hello I work with wxDevC++. I hava a "wxDirPickerCtrl" of a form how can I make this formatting? http://docs.wxwidgets.org/2.9.4/wxmsw/dirpickerctrl.png ...
[no replies]
OpenGL and C++
 
So I recently started doing things with OpenGL (after completing many 2D games in SDL) and it is relatively straightforward. However I have ran into a problem,...
[9 replies] Last: 1) Initialize your textures into some sort of variable or array. With ... (by Major Tom)
by RyanM
Theory behind this code...
 
Hello, When passing a variable/object to a method, we must use an "&" symbol in the method's signature so we can modify that variable/object and not a copy o...
[3 replies] Last: Thanks, that really helps. Great answers! (by RyanM)
August 2012 Pages: 1... 1617181920... 31
  Archived months: [jul2012] [sep2012]

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