Beginners - January 2012 (Page 18)

help with preoproscessor directives
 
i am trying to make a type from one class carry over to another class and dont know how. i need to get "Hero player" into my Battle class so it can process the ...
[4 replies] Last: why your header don't have include guard? TIP: #ifndef HEADER_NAME ... (by codekiddy)
by seppel
Constructor Syntax
 
Having defined a class A with several constructors and a default constructor the statement A a( x ); calls the corresponding constructor, given it is defined,...
[8 replies] Last: Users.Peter87.Respect++; Wazzak (by closed account zb0S216C)
double definition help
 
hello, i am getting a compile error for my program, i have been getting this error fairly frequently. Main.cpp||In function 'int main()':| Main.cpp|5|warnin...
[2 replies] Last: thx (by jpm61704)
Doubt in pointers
 
I have been told that following 2 statements are equivalent: a = 0; *(a + 5) = 0; Where a is declared as an array of integers. But then i think about...
[2 replies] Last: yep. I just printed the addresses and understood. Doubt solved! :) (by anonymized)
question about scoping and performance
 
I don't really understand caching as well as I would like, but as I understand it, it's good practice to scope variables to only exist within the range that the...
[6 replies] Last: I would like to see some proofs that it does affect performance at all... (by Peter87)
Templates..
 
Hi everyone, I have an code to write about 3 containes using templates(for different data types). But I am having a hard time grasping the logic on how to...
[4 replies] Last: It's hard to understand what you mean, Detroit. The whole idea of te... (by closed account zb0S216C)
Problem with comparing arrays
 
I am trying to compare two arrays and see how many are same and in same position. Also, see how many are same but in not same position. I dont know why but my ...
[3 replies] Last: the code was only created here. I did not give my actual code because ... (by biplav17)
Got a quick question on while loop.
 
let's say there's an array of 1 by 12 Bruce = (1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4) i want to write a while loop that will display the column number whenever t...
[1 reply] : for (int i=1; i<12; i++) { if (Bruce != Bruce [i-1]) { cout << ... (by Moschops)
by jzp253
Multiple Defintions (1,2)
 
Everything compiles fine but it wont run because of multiple defintions here is my codes. main,cpp #include <iostream> #include <string> #include "inn.h"...
[30 replies] Last: globals.h extern int PlayerChoice, e, E; extern char UserName ; Pu... (by Moschops)
error: expected unqualified-id before '{' token
 
// // Conversion - Program to convert temperture from // Celsius degrees into Fahrenheit: // Fahrenheit = Celsius * (212 - 32)/10...
[2 replies] Last: Hi, there is a couple of mistakes in your code: 1.) You placed "{" be... (by ssegota)
by tw3tye
SDL_Rect to string?
 
i have created "rect2.x" set it "x = 10" "y = 10" and im trying to display it in text to get you the idea what i want: string text = rect2.x + " " + rect2....
[2 replies] Last: Thx much. (by tw3tye)
shared dll
 
hi i have created .dll and .o file of my huffman class like this : g++ -c huffman.cpp g++ -shared -o huffman.dll huffman.o and i have also huffman.h proto f...
[4 replies] Last: i m trying to use MFC aplication to make gui for "huffman class" i ve ... (by sourena)
quadratic equation solver
 
Just finished some new code and wanted to share it because mabye some people would like it, Here it is. It solves quadratic equations and puts this (x+a)(x+b) i...
[1 reply] : Thanks for sharing, you may want to put it in the source code sub cate... (by strongdrink)
by chipp
virtual function questions
 
why if a class has a pure virtual function, it cannot instantiate an object of its own? i read on this site tutorial, it says: because in abstract base clas...
[4 replies] Last: pure virtual does not mean you may not write definition for that virtu... (by codekiddy)
Returning a pointer
 
I am trying to return a array of random numbers and it does not work receiving: int *random = new int ; creating random: int * createrandomcolors() ...
[5 replies] Last: alright thanks! (by biplav17)
GCC: Too Many Open Files
 
I've just compiled my test console and GCC overrode my std::cout 's and printed this: gmon.out: Too many open files I don't know where to start with this o...
[6 replies] Last: Thanks again, JLBorges. Wazzak (by closed account zb0S216C)
typedef
 
Hi, While looking at some code examples I saw the below typedef char ContactField ; Does the above mean that ContactField is an array of chars? Could s...
[14 replies] Last: hehe, I see we are picking on Microsoft now. Microsoft did what it di... (by webJose)
by tw3tye
SDL_Rect problem
 
void animation(SDL_Rect* nubz){ nubz.x += 32; nubz.y = 0; nubz.w = 32; nubz.h = 32; } // this next stuff is in main SDL_Rect rect1; // Pos in i...
[2 replies] Last: WOW ... I just faceplm .Going to sit in corner and cry. Thx on help. (by tw3tye)
trying to get preprosceor directives correct
 
im writing a small game in console and i know i have my preprocessor files in the wrong place. in addition to the classes below there are 2 more Hero and Monst...
[2 replies] Last: You haven't mentioned where in the file error occurs. Also, in battle.... (by Pravesh Koirala)
by kw1991
moving data from queue to a stack?
 
I'm just learning about queues and stacks. I have the queue and stack working but now i need to write a function that reverses the data inside the queue. I need...
[18 replies] Last: problem solved (by kw1991)
January 2012 Pages: 1... 1617181920... 48
  Archived months: [dec2011] [feb2012]

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