Beginners - March 2011 (Page 8)

Enum Help
 
I have done a lot of searching online for help with enums, I have found none that apply to this situation. I'm trying to make a simple single player RPG game. R...
[8 replies] Last: Yes it does. #include <string> struct Item{ enum ItemType ... (by hanst99)
Size of a char* array with different lengths
 
Hi! I have an array of char* and I just want to know, how much char* there are in the array. Normally you could do this with: sizeof(array)/sizeof(array ) bu...
[3 replies] Last: For functions, let the caller pass the size of the array. Or even bett... (by hanst99)
abs, float, math.h/cmath and Visual Studio 6.0 with Service Pack 6
 
I'm using Visual Studio 6.0 with Service Pack 6. I create a new project and compile the example code in this reference: http://www.cplusplus.com/reference/clib...
[3 replies] Last: I personally think you should upgrade from VC 6 - it was a useful th... (by guestgulkan)
What is wrong here?
 
Okay so I am making a small application to be used in large text files that have useless data. So all the data after the first space on each line gets deleted. ...
[1 reply] : In class string there is no variable named peek, as the compiler error... (by Simon Flagg)
Grading System..stuck at on point
 
Hey Peace up on you all =) am stuck at some point in this code # include <iostream.h> void main() { char x ; int y; cout<< "((use - Between the...
[7 replies] Last: Adding on to WSiaB's code, you could include string, so the user can i... (by theholyfork)
by yakkka
help for sinus equation
 
I got an error report.I stated it below. #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv ) { int value,upper_limit; float x; p...
[12 replies] Last: double sin(double x); float sinf(float x); long double sinl(long doub... (by ne555)
Functions - return values
 
I understand that #include <iostream> int main () { bla bla bla } Is a function. It has x amount of statements. Then when you return values ...
[7 replies] Last: [quote=teddyeddy] cout << ReturnNothing(); // This will not compile. ... (by hanst99)
Class Issues
 
I can't seem to resolve this error: big::bigint big::bigint::operator+(big::bigint&, big::bigint&)' must take either zero or one argument I've googled a lit...
[7 replies] Last: ostream>> You mean ostream << operator, right? Yes, I have suc... (by Browni3141)
C++ Physics engine
 
Now i'm just a beginning C++ programmer but I 've recently started coding physics formulas for calculation in C++ and was wondering is this similar to building ...
[1 reply] : An actual physics engine would not just be a number of physics functio... (by hanst99)
by craya
Designing a class of students
 
Before I say anything, this code is for some homework (probably obvious!), so I'm mainly looking for a push in the right direction. Anyway, I'm trying to mak...
[7 replies] Last: Actually I found out the issue; since the files were not included in a... (by craya)
Help with Deque - ostream_iterator
 
Hey guys need a little help with the STL and ostream_iterator. I've commented the code which isn't doing what I think it should do. I tried using virtual ...
[2 replies] Last: Thank you hanst99 for the help worked perfectly. (by lordmat)
parameters
 
int add(int x, int y) { return x + y; } int main() { using namespace std; // It is the caller of add() that decides the exact values of x and y ...
[3 replies] Last: ah thank you. You will have to bare with me, I know I am picking this ... (by teddyeddy)
Correct me if im wrong
 
See this: int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { MSG msg; static int iTickTri...
[8 replies] Last: I think he was just talking about the TRUE and FALSE macros there. (by hanst99)
by WSiaB
Assigning an Array of Pointers to an Array
 
For some reason this code generates a segfault, any ideas why? bool Memory ; bool *ptrMemory ; for (int row=0; row<8; row++) { for (int col=0; col<...
[7 replies] Last: I am guessing the earlier suggestion worked correctly since arrays and... (by WSiaB)
converting feet to meter
 
I'm writing a program that allows the user to input a string of numbers then convert it in to a double then converts the numbers to feet #include <iostrea...
[3 replies] Last: Why don't you read a float by cin? regards (by Simon Flagg)
by chipp
dinamic memory
 
i don't know what's wrong with this code, dude: #include <iostream> #include <conio.h> using namespace std; int main () { int *row; row = new int...
[19 replies] Last: I wish to apologize for throwing such confusion into this thread with ... (by closed account D80DSL3A)
how big is a char datatype one a 32bit and 64bit computer?
 
as above for a 1) 32bit 2) 64bit computer
[4 replies] Last: It's always 1 byte, but 1 byte isn't always 8 bits in C++. (by hanst99)
Help writing a Battleship board game program
 
Ok, so I went to my professor and got some help. Now my program is a bit more organized, but I cant get the ships to print onto the grid that I created. Should ...
[no replies]
How it happened?
 
Hey guys, i was doing a problem and i have to assign a 12 digit number to a variable and used unsigned long data type,when i compiled the code i got an error "i...
[1 reply] : That's because your constant is not unsigned long. 1234567890123ul ... (by hanst99)
Battleship Game
 
Hi All, I have to write the Battleship game for a programming assignment, and it's all going fine apart from one thing. On my 10x10 array grid, the boats ...
[7 replies] Last: I don't know if this will work but if you use different integers for t... (by HenryJ)
March 2011 Pages: 1... 678910... 52
  Archived months: [feb2011] [apr2011]

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