General C++ Programming - March 2013 (Page 12)

Why do I get these error?
 
Hello all, I'm trying to make a class constructor within a namespace and I keep getting errors like: "'<variable>' is a nonstatic data member of class '<class>...
[4 replies] Last: A constructor 'blah::blah' that takes the argument 'const blah &' is a... (by MikeyBoy)
I don't know where to begin
 
I will keep this as short as I can. I'm trying to make a simple game to demonstrate AI. I am using a directX framework from PlanetChili, and this is my first ti...
[7 replies] Last: I believe my issue may be because I have two D3Dgraphics objects- One ... (by viranimus)
New to c++ creating functions
 
My task: These three functions must be in a single file: - Write a function named `square` that squares an int. - Write a function named `square` that square...
[3 replies] Last: You don't really need to pass basic data types like int into functions... (by mutexe)
Help needed
 
I'm very new to programming and I have to write a program that freaking me out somewhat. Its a project and a little bit lost. I have to write a program that ask...
[10 replies] Last: The brace on 178 is the end of the floor_level function. Move it to 15... (by LB)
by gs1131
Sf
 
asdf
[4 replies] Last: Just to clarify things - your error message was telling you that you w... (by MikeyBoy)
Namespaces, Classes, and Operator Overload
 
Hello all, I'm doing a refresher for C++ and have gotten to operator overloading. I'm trying to perform an operator overload with the insertion (<<) operat...
[9 replies] Last: Gotcha, thanks. (by xanimeangiex)
Problem with Function code
 
#include <iostream> #include <string.h> using namespace std; string checker() { for(int i=0;i<8;i++) { for(int j=0; j<8;j++) { if((j+i)%2==...
[6 replies] Last: Oh i see why the error was produced earlier. Thank you! I have a bet... (by incognitocpp)
smallest cut of an array to make it sorted
 
hey .. i need help i am supposed to make a program that take a list of integers from the user and to delete the smallest part of it in order to make it sort...
[4 replies] Last: Huh, you are right, if I would increment only second when it is false ... (by zoran404)
crosslist mistake
 
#include <iostream> #include <fstream> #define Rownum 4 #define Colnum 4 int a ={{1,3,0,3}, {4,0,3,2}, {5,0,2,1}, {3,3,1,4}}; using namespace std; ...
[3 replies] Last: marking it as solved will help others to move to other posts.. (by writetonsharma)
by Serena
Problems with an easy C++ code
 
Hey guys, I'm totally new to this forum and I'm also totally new to programming. I've wrote this short code down below and it doesn't really work. Can anyone he...
[7 replies] Last: #include<iostream> using namespace std; const char MAX_LENGTH = 32;... (by Skuzzi)
Please help me solve this problem regarding inheritance.
 
#include<iostream> using namespace std; class spl { public: string myInt; spl() { myInt="Hello this is my first text"; ...
[3 replies] Last: To the OP: As things stand, you can't do this. Yes, the mem class... (by MikeyBoy)
by black5
Classes and UML
 
Create a class representing project activities. In this class include all the required data members and member functions. Each activity should have a record of ...
[2 replies] Last: Understanding classes is about as basic as it gets in C++ programming,... (by MikeyBoy)
Okay
 
Say i wanted to make my own 3D game engine, what are all the concept I would have to factor in, and all the different types of files I would need to use to do t...
[2 replies] Last: Okay, thank-you! (by Joshrocksforeverandever)
Error in sort words dictionary by using AVL tree
 
Help me fix this error. file .h #ifndef BST_H #define BST_H #include <iostream> #include <cstring> #include <iomanip> template <class T> struct Nod...
[1 reply] : What is the error ? (by writetonsharma)
Help needed.
 
Hey , i have code that reads an input file and generates an output file .For reading the input file we have a xml file.If there is an error while reading or wri...
[1 reply] : without looking at the code, its tough to tell the solution. generall... (by writetonsharma)
can someone help me with an array
 
i'm getting some odd out put from this one. I can't really explain it // problem using an array #include<iostream> using namespace std; int main() ...
[3 replies] Last: not initializing the values of the array to 0 will leave garbage value... (by palauan73)
How to get the value of a variable from an equation
 
I'm a newbie in c++ programming, and like the title explains. I need to figure out how to take two variables with values such as a 1; and b 2;. Now you tak...
[1 reply] : http://www.learncpp.com/cpp-tutorial/13-a-first-look-at-variables/ For... (by MiiNiPaa)
Recursion functions
 
int m3(int n) { if (n==1) return 25; else return n + m3(n-1); } If I called cout << m3(5); in int main would it really return 39? Why is that? ...
[1 reply] : If I called cout << m3(5); in int main would it really return 39? Ye... (by cire)
by tranen
C++ cplex variable problem in loop for and random number
 
Hi, I'm new using Cplex callable library in a C++ environment I got a problem in my program. I know where but I don't know why. Here is my code: int ...
[no replies]
Recursion help
 
void review(int n) { if (n>0) { review(n/2); cout <<n<<" "; } } If i called review(14) would the output be 1 3 7 14? I ran this code i...
[1 reply] : 1.review(14) 2. --> review(7) 3. --> review(3) 4. --> review(1)... (by Adam McBride)
March 2013 Pages: 1... 1011121314... 51
  Archived months: [feb2013] [apr2013]

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