General C++ Programming - July 2011 (Page 11)

by gizzmo
text UI
 
Hi, I have a peace of code that I wrote in C long time ago. Therefore it uses functions and unfortunately also global variables. Its purpose was to read parame...
[1 reply] : Maybe something like Parser p("filename"); Calculator c( p.get_some... (by hamsterman)
[Help] C++ Object Oriented Programming
 
Solved
[1 reply] : The code itself is fine, though I don't see why you have the name and ... (by Zhuge)
Email issues
 
I can't send an email with c++ and i have been searching for a while and it's bugging me. here is my code: #include <iostream> #include <winsock2.h> #prag...
[6 replies] Last: A little googling produced this: http://www.coastrd.com/smtps which ma... (by Galik)
String as Variable Name
 
Is there any way to use the data from a string variable as the name for another variable?
[5 replies] Last: myvars["whatever"] = 5; . Line 13 does that only with the name stored... (by hamsterman)
My first Game - Snake
 
This is my first attempt at a game. It is a classic, snake. If anyone has any pointers or constructive criticism that would be much appreciated. If so, p...
[5 replies] Last: come on disch. I said it was my first game. I didn't say it was bad... (by Disch)
pausing a program before it terminates
 
I've found a number of different ways to "pause" a program before it terminates, and each one seems to have its own dear friends and bitter enemies. The most...
[3 replies] Last: I just do this: while (true) {} (by creekist)
What does this below line means.
 
In the function declarations, the argument identifiers are optional. In the definitions, they are required (the identifiers are required only in C, not C++). ...
[1 reply] : Ok essentially it means that the specific names of the local variables... (by creekist)
Include guards in C
 
Is it necessary to include guards in C. Because we can declare functions anytime(only the definition needs to be once). C++ have classes hence there is a chance...
[3 replies] Last: Oh Thanks. Structs are there in C++. I was just wondering why do we ne... (by howtechstuffworks)
Fibinacci Algorithm help
 
#include <iostream> using namespace std; int fibinacci(int n) { int u=0; int v=1; int i,t; for(i=2; i<n; i++) { t=u+...
[8 replies] Last: @Vindifreek what I meant with using a string is then the maximum numbe... (by shacktar)
Sockets?
 
Why do you need to telnet the client and server? Doesn't connect() do the job of connecting the computers? What does telnet do and how do I make my client/ser...
[9 replies] Last: oh okay thanks that summed it up perfectly (by TheCreator)
SendMessage()
 
I'm making a simple console program that will use FindWindow to get the HWND of another program that is open. I'm then looping in a while loop trying to use Se...
[1 reply] : The SendMessage function does not return a bool (or int) indicating su... (by shacktar)
Global Objects
 
Im making a game engine right now and i need to make an object called "engine" from the Engine class available to all the other classes i made in other source f...
[5 replies] Last: Hi, I believe if you want to make members of objects of type Engine to... (by creekist)
by Nybble
File I/O manipulation
 
for (int y=0;y<MapH;y++) { for (int x=0;x<MapW;x++) { fscanf(FileName, "%d:%d ", &a, &b); } } This works really well for load...
[4 replies] Last: I don't understand why it is working now and it wasn't a minute ago...... (by Nybble)
How do you pass an integer to a string?
 
I'm wondering what are some other ways to pass an integer to a string. I know of using the stringstream function from the header file <sstream> but when I do u...
[4 replies] Last: Just for fun I'm posting another method that is a little more versatil... (by disciple777)
What is wrong with my HandleEvents function?
 
Hello, what this function is suppose to do is wait for the user to either click button one, button two, or ex out the program. Instead, i get this error: ...
[4 replies] Last: @ disch: Here is the code for ChangeState: void ChangeState( GameSt... (by nano511)
by eth0
Correct return/reference for Multidimensional Structure
 
Hi there, I have 2 structures defined as follows: struct afb2d_Adata{ int hpfR,hpfC,lpfC,lpfR; float *hpf; float *lpf; } struct afb2d_data{ afb2d_A...
[4 replies] Last: Thank you! (by eth0)
Installing Libraries
 
Im trying to install sfml library on a Mac. I use netbeans, but I couldn't find any instructions for netbeans. Could you please give me detailed instructions o...
[1 reply] : Not that I've ever used Natbeans much or have a Mac.. see http://zetco... (by hamsterman)
Declaring ofstream variable in Visual Studio 2010
 
Hey, How do you declare a variable as ofstream type in Visual Studio 2010. I have the following and am getting an error stating:syntax error:missing; before ...
[3 replies] Last: Visual Studio 6.0 comes from a time when C++ looked a lot like C. Nowa... (by Catfish)
by eth0
Structure Data Corruption
 
Hi there, I seem to be having data corruption within a structure. In a function in which I manipulate data I have tested the contents of the function and they ...
[6 replies] Last: Awesome, that fixed it. Thanks for the help and the tip! (by eth0)
by phhs80
Looking for examples of OpenMP in C++
 
Dear All, I would like to use OpenMP in C++. Could someone please direct me to some working examples? Thanks in advance, Paul
[2 replies] Last: Thanks, Ausairman, for your useful reply -- I will try to follow your ... (by phhs80)
July 2011 Pages: 1... 910111213... 30
  Archived months: [jun2011] [aug2011]

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