- Strength to Increase Rep
- +3
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
I have a number of functions I would like to reuse in multiple pieces of code. I have put these into a single header file that looks something like the following: [CODE] #ifndef FUNCTIONS_H #define FUNCTIONS_H //function prototypes extern float sum(vector<float> &v); //calculate sum of a vector float sum(vector<float> &v) … |
|
Hi all! I've read forward declaration is much prefered than include in header files mainly because it reduces the compilation time. Other reasons? My particular situation is that all header files that I use are within a namespace. I've seen two different ways for forward declaration in this case: [CODE] … |
|
I want to make a program, that will run every time I turn on the computer. Like Skype.. or Anti Virus programs. How would I do that? |
|
Please consider a beginner/intermediate question for which searching Google has provided me no results. I am attempting to write a program that compiles a script program into an assembly language module that I will then link to the main C++ program using Visual Studio. How is it possible for a … |
|
I am making a program and I want to be able to determine the refresh rate of the monitor somehow (to limit an fps cap). I am using windows API. Is there anyway to access this? |
|
Hi everyone! I wrote code for the progress bar but the thing is that it is just an empty bar and nothing goes on. So how can make it update? [CODE] #include <windows.h> #include <commctrl.h> #include "Resource.h" //--------------------------------------------------------------------------- RECT rcClient; HWND hWnd; HWND hProgress; HWND hDlg; HINSTANCE hInst; int pb_pos; … |
|
I'm brand new to C++ ,I've written following code for finding a number's factorial,Can you please let me know how to write it more elegantly ? [CODE]#include <iostream> using namespace std ; main () { int num = 0 ; // declaring variables double result = 1 ; long int … |
|
Hi During the last 6 months or so I've worked on and off on a couple of a classes to send data over network using winsock and asynchronous sockets on windows. Basically my system works like this. The server will send packets on a connection until WSAGetLastError() returns WSAEWOULDBLOCK the … |
|
Hi, I've ran into a problem with pointers which I can't seem to get my head around. Here's some code that illustrates my problem. [CODE]void Reallocate(char* Source) { int NumberTest = 0; char* Buffer = new char[4]; memcpy(Buffer, Source, 4); delete[] Source; Source = Buffer; memcpy(&NumberTest, Source, 4);//This puts the … |
|
Hi everybody, this text turned out to be rather long and maybe not so clear, please excuse me. I'm currently using the winsock library to send and receive data in an application made with WinAPI, I'm not using MFC. I'm using asynchronous sockets (I think that's what it's called) which … |
|
If I wanted to declare a large number of variables that were all similar, for example: [code=c] var x1; var x2; var x3; var x4; var x5; var x6; var x7; var x8; var x9; var x10; var x11; [/code] ...etc Is there a faster way to do that? Maybe … |
|
Hi I'm currently writing an Othello game using the Windows API. I have 3 classes in my program, the first class is simply called "Othello" and it handles almost everything. I also have a class called Field that's used to control which fields are black which are white etc. My … |
|
My c++ code [CODE=c] string map = "111111111111111111111111111" for (int i = 0; i < 20; i++) { int number = atoi(map[i]); } [/CODE] Gave me error: cannot convert parameter 1 from 'char' to 'const char *' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style … |
|
From project euler : [code] By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. [COLOR="Red"]3[/COLOR] [COLOR="red"]7[/COLOR] 4 2 [COLOR="red"]4[/COLOR] 6 8 5 [COLOR="red"]9[/COLOR] 3 That is, 3 + 7 + 4 + … |
|
Hi! I've recently started to make some programs with the windows API using C++. The problem I'm having right now is that I've created an application, and now I want to share it with the world (or at least some selected few). I've coded the program on my laptop win … |