General C++ Programming - March 2012 (Page 9)

C++ Help primary-expression before "int"
 
Whats wrong with my code? I get a expected primary-expression before "int"... for (getMaxNum) function Heres my code: http://ideone.com/vz9sE
[3 replies] Last: This is a pretty simple fix. Up above, in your "prototype" you have yo... (by Baelix)
Reading numbers in from file
 
Hey in my C++ code, here is my input file 30713 4 3 3 4 3 3 2 3 4 3 21356 4 4 4 3 3 3 2 3 2 3 21265 4 1.5 3 3 3 0.5 2 3 3 3 19364 4 3 3 3 -1 19335 0 3...
[2 replies] Last: This is what a stringstream is for. Also, don't loop on EOF. #inc... (by Duthomhas)
Error C2440
 
Here my code #include <iostream> #include <string> #include <ctime> #include <cstdlib> using namespace std; int main() { char x; char a; char ...
[5 replies] Last: thank you very much for your help, use strings instead. =] (by Invader2010)
Compile Time Randomisation
 
Hi, does anyone know of adding per-compile data to a binary? I have written some code that loads some data, then converts it into a better format for my applica...
[2 replies] Last: Why not have a file version in the file? That is I assume you are chan... (by closed account o1vk4iN6)
by cdf
segfault with dynamic allocation
 
... actually with trying to initialize an allocated object. the other class works properly, the memory is what does the actual allocation, called inside th...
[6 replies] Last: no, my main is really simple, for debugging all it does is call the co... (by cdf)
void issues with ';'
 
no matter what i do i cant seem to get rid of this thing where no matter where i place my void namephase() it always has an error saying it expected a ';' pleas...
[19 replies] Last: Yeah, I figured that was the problem. I still am the same way with mor... (by BHX)
template<class> linked list issue
 
the issue i am having is im creating a template class that needs members of its own class type, as pointers or actual class object members ie: template<class...
[16 replies] Last: how do you reference an object via the handle? i cant find any tutoria... (by GFreak45)
Help for game
 
Hello, I am trying to make a dwarf fortress like game. I need some help on a few things. 1. How do I go about making a map genorator. 2. How do I display mod...
[no replies]
Midterm help please.
 
Assignment: Show off what you can create with what you've learned about Processing this semester. Don't hold back. This should be your best work so far. Th...
[1 reply] : My current idea is to create a tennis racket in the middle of the scre... (by tennisjad3)
C++ code cant detect the class or the int inside the class.
 
Code: #include <iostream> #include <string> #include <ctime> #include <cstdlib> using namespace std; int damageDealt; char Action; class Boar; class Play...
[5 replies] Last: i dont know how to, and i dont know where he got that string foo thing... (by Invader2010)
infile/outfile.dat
 
Repost without tags Any help much appreciated! int main () { const int arraySize=12; double a ,m; ifstream fin; ofstream fout; fin.open("infile.dat")...
[1 reply] : What's the question????? Please use code paranthesis so that people co... (by TheDestroyer)
BigInt Datatype
 
I need an integer datatype that can hold a maximum of 20 digits. I have tried __int64 and long long with no success. How would I make use of the BigInt datatype...
[3 replies] Last: Don't know. I've never used that lib myself. Check the site for so... (by Disch)
by Jode
SFML - Window does not appear?
 
Hi, I've been working a bit in SFML and OpenGL (1.1). Sadly, however, I am unable to get past the first step: creating a window. Here's my code (only the proble...
[8 replies] Last: I'll look over my project config, see if everything is looking right. (by Jode)
Output XOR operation
 
I found this online to get an idea how to build an encryption function but why can't I output each operation as in e.g. cout << string ^key ; Here is t...
[3 replies] Last: It's correct if it's after the for loop. (string gets changed in the f... (by cire)
by k0t4
Hex dump issue
 
Ok I've written a simple command line program to do a hex dump of a file. It reads in unformatted data converts it to hex and prints out the hex until it hits a...
[2 replies] Last: Ok I'll have to try that. I know on the text file it isn't exiting on ... (by k0t4)
Convert string to int
 
I am trying to subtract one time from another eg: 16:10 - 09:10. It is a program for calculating wages on an hourly rate. I am inputting the times through the ...
[2 replies] Last: Instead of doing... std::string example = "05"; atoi(example); Do s... (by S G H)
Why are they restarting the key?
 
Hi, I need to write a simple encryption function so I found this online to get familiarized w/ it: void encrypt_data(FILE* input_file, FILE* output_file, ch...
[1 reply] : The key is a string. So it's using each character in the string in ro... (by kbw)
C1075 fatal error...
 
i am getting this error. "fatal error C1075: end of file found before the left brace '{'" what did i do?
[1 reply] : You have a syntax problem with your braces. Check that all your braces... (by Zhuge)
by larjy
C++ loop!
 
Solved
[no replies]
by Dreyth
Just a little help needed with my game
 
My first post. I'll cut straight to it: How do I make it so that if the user inputs a negative number, the program will display "Too bad, the solution was [th...
[1 reply] : Something like this? // Take care of correct or incorrect guesses. ... (by BlackSheep)
March 2012 Pages: 1... 7891011... 49
  Archived months: [feb2012] [apr2012]

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