General C++ Programming - May 2012 (Page 3)

by Bai Su
what's wrong with this piece of code
 
class test{ public: struct one{ }; friend one foo(); }; In vc2010, the compiler says foo() cannot overload functions distin...
[8 replies] Last: You don't have to have a definition. friend just informs the compile... (by closed account zb0S216C)
by Brett
reference does not work, please help
 
I want to use reference to swap i and j in below code,however, it does not work, please help.but if i put void swap (int &, int &) before main() , it wor...
[11 replies] Last: Maybe updating your compiler will resolve the issue. Something like VC... (by closed account zb0S216C)
C++ CrossPlatform Game Design
 
Hello, As the title says, is there a cross platform plug-in/add-on/whatever that works with C++ for game development? (Seems funny to ask, but it can't hurt ...
[5 replies] Last: I'll have a look, thanks again. (by closed account 3TXyhbRD)
by Nandi
Primary expressions needed !!
 
hi ! i cant seem to find the problem in the code. The errors are: 39 primary-expression before "double" 39 expected primary-expression before "char" 39 ex...
[2 replies] Last: When you call a function, you don't include the parameter types in the... (by cire)
by mx760
Doubly linked list ordered insert
 
I'm curious as to why I cannot delete pointer cur in my d_ordered_insert function, since isn't it just a copy of the front pointer? (When I uncommented the d...
[4 replies] Last: So we only use delete for deleting dynamically allocated memory, not f... (by mx760)
Compute Area and Circumference of Circle.
 
// ProgrammingAssignmentSeven.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include <cmath> u...
[1 reply] : computeArea does not return anything, but you are trying to get a retu... (by Zhuge)
C++ alpha-beta-pruining
 
So here's some alpha-beta pseudocode that I'm doing for the Fif game that I'm making of me vs. computer (VERY similar to tic tac toe) I'm working on the 3rd li...
[no replies]
C++ Question Arrays, Classes, Passing Functions
 
Hi, I'm new to C++ (maybe my code below will make it obvious) But I'm doing an Array problem and I was wondering, how would I go about passing arrays between me...
[9 replies] Last: 1) Constructor - The function of the constructor is to create your ob... (by slider57)
by Nandi
Compiling Errors !!
 
Hi ! i'm recieving the following errors when trying to compile: 27 unqualified-id before '{' token 27 `,' or `;' before '{' token #include<ios...
[1 reply] : Use code tags and put in some indentation and the problem will become ... (by firedraco)
by Saurog
Why is a new pointer deleting information from anotherone? (1,2)
 
I apologize for the words in spanish, but basicly what im trying to do in this funtion is to create a new set. But when i create a double pointer one of the par...
[22 replies] Last: it work, thanks. ammm want me to post something about CAnalizador::Set... (by Saurog)
Store values in int variables with equations
 
Hi, I'm fairly new to C++ (have only used the language for a few years) and I am not sure how (or even if) there is a way of doing something similar to this: ...
[6 replies] Last: Thanks heaps, that will do exactly what I wanted to do. (by steve9164)
Too many arguments?
 
I am writing just a basic keylogger for practice in C++ and such. I don't get any errors except this one: Too many arguments to function 'BOOL FreeConsole()...
[1 reply] : You'll find the prototype is BOOL FreeConsole(void); This means Fre... (by kbw)
by Nandi
compiling problem
 
#include<iostream> #include<sstream> using namespace std; const string VERSION = "JEWELLERY"; const int MAXSIZE = 1000; // maximum number of records allowe...
[no replies]
Function pointer example STL
 
#include <algorithm> #include <iostream> #include <list> bool compare(int n) { return ((n % 3) == 0); } int main() {...
[1 reply] : No elements are removed from the container. See here: http://www.cplus... (by Athar)
by JJJSSS
Need help with input/output files for arrays
 
I'm having problems getting the list of numbers from P4Data.txt to output into arrays in P4.txt. The readFile function is correct but the writeFile function ...
[1 reply] : The output should be in this form: index x y m 0 ... (by JJJSSS)
Formatted strings how?
 
Hey guys! I've looked all over google and I can't figure out how to do this. I want to know how I can implement formatted strings into functions. You know how y...
[4 replies] Last: Thank you! This is very helpful! =D (by SuperSonic)
by BasV
Operator overloading and memory management
 
Hello, I want to add overloaded operators to my Point class that allow me to do operations like: Point* p1 = new Point(5, 10); Point* p2 = new Point(1, ...
[8 replies] Last: I need to declare it outside the class in that case then? Yes, exact... (by Athar)
Game of Life help
 
Can someone help me get started on this. This is the code I was given. I have to get the program to run. I just feel like this is a little bit out of my knowled...
[no replies]
by JJJSSS
Multi-File Program (Need help fixing)
 
This post has turned into a complete waste since I changed a LOT due to many updates/corrections from the professor on the project.
[11 replies] Last: You call the function by calling the function. None of the standard l... (by cire)
by snig
input problems (NOOB)
 
I have a while loop that gets user input and it sorts it in a char. I am using the >> stream operator. I understand that if a user enters 2 letter it will loop ...
[1 reply] : The topic has been raised many times under different scenarios. In th... (by webJose)
May 2012 Pages: 12345... 41
  Archived months: [apr2012] [jun2012]

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