General C++ Programming - July 2012 (Page 8)

timer
 
Hi. I may need a timer to run my Win32 program. How do I include the timer into my project window and into the toolbox if that is where it is where it belongs. ...
[1 reply] : If your compiler supports C++11, you can write a simple timer using "c... (by majidkamali1370)
Issue with sprintf function
 
Hello forum! I am getting a strange error through Visual Studio when I use sprintf in my program. So, in my code, I define a struct with a few internal va...
[3 replies] Last: @ne555, Sorry, I incorrectly typed in pointers in my original post! I... (by WillWorkForCoffee)
question
 
how do you open a file whose name contains a backslash, such as: temp\output.dat or c:\temp\output.dat
[3 replies] Last: Yes. fstream myfile("C:/path/to/your/file/filename.txt"); ... (by Disch)
The output is not correct
 
Ok, I am creating this program that calculates and displays the amount of annual raises for the next three years, using rates of 2%. 3%, 4% and 5%. The progra...
[10 replies] Last: I found the problem and I fixed it. My question is solved. Thanks fo... (by Diana Magers)
pointers
 
hi all I dont know why the third line in output is nothing. allocate memory in func and assign it to main_ptr but when return from func what happen to that m...
[1 reply] : Your function leaks. You are modifying a copy of the pointer. (by ne555)
static memory allocation
 
For a static object declared in a file which is going to be separately compiled- (i) what exactly happens at compile time. - Does size of the .o file incr...
[1 reply] : (i) what exactly happens at compile time. the size of each static is... (by Cubbi)
question
 
what happens if you call: in_file.open(""); without a physical name??
[4 replies] Last: thanks Disch :) (by nanadien)
by qingze
Need help of a comparison sentence!
 
Dear all, there are several comparison sentences in my program that probably cause serious problem if (arrayS <=1.25) { arrayf =4*arrayS -4; } if (1...
[3 replies] Last: Note you can avoid that && crap by just using else. less typing, less... (by Disch)
Direct 3D Simple pipeline problem?
 
Hi I am creating my first direct3d program and have just created a pipeline and as you probably guessed can't work out why the triangle I have created is not...
[3 replies] Last: Its really hard to say without seeing what is happening in your other ... (by bmiller)
by nt162
tree with multiple nodes
 
Hey all! I created 3 classes: tNode, dNode and myTree. In the beginning of my code i create a vector<dNode*> with a fixed size and that vector never chang...
[no replies]
Placing classes in separate files
 
Hi there , I have tried to create a separate file for the class Stack , however it gives the following error : undefined reference for 'WinMain@16' Here ...
[9 replies] Last: At last , I did it. 1. Reinstalled Codeblocks and 2. Created a new p... (by Raman009)
Flash Drive Keylogger help (1,2)
 
when i execute my keylogger in a flash drive, it doesnt pick up all the keystrokes like it does when i exexcute it from anyother location. source code: #i...
[30 replies] Last: like i said before, i dont like using other people's software (by pharohbot)
Confusing map problem
 
Hey, guys ! Firstly ... here are the files https://docs.google.com/folder/d/0B06r_mXrdWb-elAwV0dlcVNFOG8/edit addnote.h and addnote.cpp in addnote.cpp ther...
[7 replies] Last: Ok ! I finally solved it :) It seems like though the error was realted... (by TwoOfDiamonds)
by viliml
Need help for function converting
 
I have this function: bool f(string a, string b) { for(int i=0; i<a.size(); i++) a =tolower(a ); for(int i=0; i<b.size(); i++) b =tolo...
[4 replies] Last: > when only one operator is needed to define them all ... In general ... (by JLBorges)
Difference Between C, C++, C# and Objective-C (1,2)
 
Hi! I just wanted to ask the difference between C, C++, C# and Objective-C. Currently I am learning C++ but for Windows apps I need C and for Mac apps I need O...
[20 replies] Last: Mono is not Microsoft property, it's a project developed in an effort ... (by closed account 3TXyhbRD)
what is wrong?
 
is this function right? when i put (1,0,0,1,1) it return true..... bool palindrome_2(vector<int>vec,int begin,int end){ if( vec != vec )...
[3 replies] Last: You need to stop call palindrome_2 if begin >= end. (by Peter87)
by CMarco
int to char
 
Hello to all I have an integer that works like a counter and I have to put the content of the count in a char type. I try like this: int aa++; // goes ...
[12 replies] Last: thanks to all for the awesome advises... Regards, CMarco (by CMarco)
Automatic Casting of Integer to an Arbitrary Object
 
Hi Everyone, I have been using C++ for many years. Recently I faced a very strange issue for which I couldn't find any explanation. Consider the following ex...
[3 replies] Last: Thanks a lot Abramus. It solved my problem! (by bastani)
int -> binary recursion
 
first code int base2(int num){ if( num ==0) return 0; base2(num/2); cout << num%2; } if i put return front of ...
[3 replies] Last: The correct code may be like following : int base2(int num){ ... (by viliml)
by ozma
call dll function from another dll
 
Hi, im having problem to call a dll function from dll the code look like this.. //file : a.cpp int main(){ HINSTANCE dllHandle = LoadLibrary(TEXT("...
[3 replies] Last: @webJose Tq for pointing __stdcall .. :) the program run well withou... (by ozma)
July 2012 Pages: 1... 678910... 30
  Archived months: [jun2012] [aug2012]

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