Beginners - June 2012 (Page 14)

by Roney
Regarding Allegro
 
Hi, i am trying to create a galaxian similar game by using c++ and allegro. The problem right now is the in order for the alien to move slowly, i have to use th...
[5 replies] Last: What you're looking for is what I said. The vector is what will ultima... (by Ikaron)
C++ Programming assistance of the errors
 
Hey Guys, I am wondering if you guys can help me fix some of the errors I am getting. I want to do a running average for example like three points. Here'...
[4 replies] Last: I figured out the problem but now trying to figure out why my executab... (by NimmyRod)
Help with friend classes
 
I'm trying to make a friend class, but it doesn't seem to be working: class Tester; class Test { public: typedef Tester test; Test(){}; ~Test(){}...
[6 replies] Last: Hmm, in my real file it is okay. (Slow day, had fun with my linked li... (by Lowest0ne)
by enahs
Basic pointer question
 
So I have the following code: *(pol1Card1+(i-1)) = ( *(pBuffer+(8*i-8)) + *(pBuffer+(8*i-6)) + *(pBuffer+(8*i-4)) + *(pBuffer+(8*i-2))/4 ) ; I am trying t...
[2 replies] Last: Yes you are taking the values in the actually buffer. Although I don'... (by Disch)
inserting into an array
 
ok so my dilemma is that Im writing a function that inserts a number into an integer array that is supposed to bump the existing numbers after it up in position...
[11 replies] Last: yeah it was how they wanted it in an assignment... I had just stared ... (by theRuffneck)
by leeffm
char array
 
http://codepad.org/9zy1sxM6 Im writing a checkers game to work like a tic tac toe console game., i dont now how to make the array use a double char output fo...
[2 replies] Last: ok , thanks (by leeffm)
Setting pointer to object equal to iter? (1,2)
 
Alright, so here's the situation. I have a std::vector<Class>::iterator. I have a member of the same class type, that is a pointer. If I understand interators r...
[23 replies] Last: [quote=ResidentBiscuit] "Do you mind elaborating a bit as to why they ... (by closed account zb0S216C)
Help with Array of Objects
 
Hi all. I’m supposed to be writing a code that involves arrays of objects and I’m becoming a bit overwhelmed with a certain part of the code. I feel I mi...
[10 replies] Last: You're thinking of classes wrong. A function inside a class follows th... (by ResidentBiscuit)
How to EOF
 
Does anybody know how to do EOF ? How do you do it so that it has the option for Ctr+Z and for Unix Ctr+D This is my code for example, where, and how exac...
[7 replies] Last: ended up doing this and it seems to work while(cin.eof()) { cout... (by CPPRaven)
gcc makefile hello world
 
hi I'm trying to code hello world in GCC, but whilst I get my simple makefile correctly, the problem comes when I try to use <iostream> or even my own header...
[9 replies] Last: I suppose you could always try this: all: g++ -Wall -Wextra -pedanti... (by Catfish2)
inversion computer science?
 
hi How is an inversion computed in computer science? Lets say on an array like its being talked about on wikipedia (http://en.wikipedia.org/wiki/Inversion_(d...
[1 reply] : The link you provided is broken for me but I think I know where you ar... (by Stewbond)
by leeto
Function push() and pop()
 
Push() - It should store the element at the current position in the embedded array. Increment the current position afterwards. There is no need for checking the...
[1 reply] : I'm guessing that you're talking about std::queue::push() and std::... (by Stewbond)
maximum product of the numbers which have the sum n
 
I must write a program that gives the maximum product of the numbers that added are equal to n, a value entered by user. I could only come up with a a simplifie...
[3 replies] Last: In your example for n=10, you have 2^5 which is actually supposed to b... (by fg109)
Linking Libraries Help
 
I would like to change the directories where g++ searches for linked libraries permanently. Basically I want to add a few directories where third party librarie...
[3 replies] Last: Many settings for GCC can be controlled with environment variables. ht... (by codeFoil)
Difference endl and \n
 
Well, the title basically tells it all. What is the difference between \n and endl, from what I learn, they both clear and start a new line. But what is the dif...
[5 replies] Last: If you're interested, I once made an object ( class logger ) that was ... (by Stewbond)
Program to find sum of N is less than x and N+1 is greater
 
I am trying to write a program that will find an integer N that the sum of 1+2+3...N is less than 31096 and N+1 is greater than 31096. I wrote a program yest...
[9 replies] Last: @Phil123 OK, I see it now... It's just (total + (n + 1) + (n + 2) >... (by fg109)
by myoni
void* and memory allocation
 
I tried this code: void *arr = new (int *) ; for (int x=0; x<num; x++) cin>>(int*)arr ; delete arr; but I get errors what the problem ?...
[8 replies] Last: T * arr = new int ; wasn't it should be: T * arr = new T ; ... (by chipp)
Getting type of void* data
 
I am wondering if it is possible to identify the type of data referenced by a void pointer if you do not know ahead of time what the possibilities are. I wou...
[2 replies] Last: You could make a template function, or overloaded functions. (by Lowest0ne)
String problems
 
Well I have made this program with a class that when called with the setMessage() it will set the message then when getMessage() is called it should display the...
[5 replies] Last: Thanks! yea just a bit tired and cant think straight. (by DisobeyedCoot)
by enahs
Pointer operand assignment
 
Hello, I have a pointer array full of data. I am trying to create another pointer array, and access various bits of the data in that array to reorganize the ...
[2 replies] Last: Thanks vlad. That fixed the compiling issues, Now, the code is not be... (by enahs)
June 2012 Pages: 1... 1213141516... 51
  Archived months: [may2012] [jul2012]

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