Search:

Type: Posts; User: DarkAlex

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. Thread: array size

    by DarkAlex
    Replies
    1
    Views
    1,087

    input_line[0] is the first character in the...

    input_line[0] is the first character in the array. It does not refer to the array's size.

    If the value of input_line[0] is equal to "0", then your user is inputting "0".
  2. Replies
    2
    Views
    1,079

    Oh. That makes sense. I guess I was thinking...

    Oh. That makes sense.

    I guess I was thinking that I was using it as an argument.

    Now that I'm calling the function correctly, the code complies.

    Thanks for your help.
  3. Replies
    2
    Views
    1,079

    Inlined functions as arguments

    I am attempting to inline a member function as an argument of an equation.


    Player.hitper=((d10.roll-1)*10)+(d10.roll-1);

    d10 is a object of the class dice.
    The class to which the function...
  4. Replies
    5
    Views
    3,440

    Thanks! It works now. I probably should have...

    Thanks! It works now. I probably should have thought of that before.
  5. Replies
    5
    Views
    3,440

    Oh, right, forgot to post the error message I got.

    Oh, right, forgot to post the error message I got.
  6. Replies
    5
    Views
    3,440

    Help with NULL arguments

    I'm having trouble with sending NULL as an argument for a pointer. The functions and calls are as follows:


    void room::build_connections(room* uparg, room* downarg, room* northarg, room*...
  7. The 'bow' is currently a bool, but I intend to...

    The 'bow' is currently a bool, but I intend to actually turn it into a legit 'weapons' object.

    I've gotten a suggestion to place the classes and class properties into their own header files and...
  8. Player is an object of a class I call character,...

    Player is an object of a class I call character, which inherits from a class lifeform.
    This is the code for all lifeform and all classes that inherit from it.


    class lifeform
    {
    public:
    ...
  9. #include #include #include...

    #include <cstdio>
    #include <cstdlib>
    #include <iostream>
    #include <string.h>
    #include <fstream>

    Those are the header files I'm including, and similar file operation programs compiled without...
  10. Ok, that fixed the load error, and replaced it...

    Ok, that fixed the load error, and replaced it with:


    followed by a really long incomprehensible function name.
  11. "No match for 'operator' token"

    In a program that I'm working on, I'm having problems with the 'save' and 'load' functions.

    Save:


    int save()
    {
    string filename;
    do
    {
  12. Replies
    4
    Views
    1,596

    Ok. Thanks for the help, and for clearing up the...

    Ok. Thanks for the help, and for clearing up the terms. I'l be sure to use the term 'containment' to describe this situation from now on.
  13. Replies
    30
    Views
    2,930

    First, declare something like this: double...

    First, declare something like this:

    double value, postotal, negtotal;
    Then the end of the loop should check for negativity like this: If it's greater than 0, add value to postotal, else add value...
  14. Replies
    4
    Views
    1,596

    Nesting classes

    According to my C++ book, the following is legal:


    class a_class
    {
    public:
    int one;
    int two;
    };
  15. Replies
    6
    Views
    1,283

    Thank you for your help with fixing my coding...

    Thank you for your help with fixing my coding style. The problems I had with my program were that I had not set a value for maxdef for either character, and the load error was because I forgot to...
  16. Replies
    6
    Views
    1,283

    Crashing and load data errors

    A text-based game I'm working on is having several bugs I can't find. The battle system crashes the game if the user inputs the command to "block" or after a few commands and the load method fails...
  17. Replies
    2
    Views
    1,436

    I don't know if this is the right solution, but...

    I don't know if this is the right solution, but try this instead of cin:

    getline( cin, students);
    I had problems with just standard cin as well, but my problem was that the input was only one...
  18. Thread: choice error

    by DarkAlex
    Replies
    9
    Views
    1,879

    Yep, I do have to admit that. I also noticed that...

    Yep, I do have to admit that. I also noticed that I had made this error in other areas of the program that would not have been good there. I also noticed that I had used == instead of = in three...
  19. Thread: choice error

    by DarkAlex
    Replies
    9
    Views
    1,879

    That fixed it, thank you. That makes me feel...

    That fixed it, thank you. That makes me feel stupid.
  20. Thread: choice error

    by DarkAlex
    Replies
    9
    Views
    1,879

    I intended for all input to be in lowercase. This...

    I intended for all input to be in lowercase. This code worked until recently, and both places where it was placed stopped working.

    EDIT: I'm pretty sure I didn't change the check to lowercase, as...
  21. Thread: choice error

    by DarkAlex
    Replies
    9
    Views
    1,879

    It's code I got off of a question I asked a...

    It's code I got off of a question I asked a couple of months ago. http://cboard.cprogramming.com/showthread.php?t=106347

    It was to equate any input beginning with 'y' to 'y'. The code didn't act...
  22. Thread: choice error

    by DarkAlex
    Replies
    9
    Views
    1,879

    choice error

    I'm having trouble with two nearly identical blocks of code in my program:


    do
    {
    cout<<"What is your charater's name?\n";
    cin.ignore();
    getline( cin,...
  23. Replies
    132
    Views
    721,347

    Sticky: The first game I ever finished completely,...

    The first game I ever finished completely, RockPaperScissors with sound! Not very good, but an upgraded version will appear in DarkRPG, eventually.

    An upgraded version of the second game I made,...
  24. Thread: String error

    by DarkAlex
    Replies
    8
    Views
    1,455

    Thanks. That fixed it.

    Thanks. That fixed it.
  25. Thread: String error

    by DarkAlex
    Replies
    8
    Views
    1,455

    This is the code where I tested the new input...

    This is the code where I tested the new input statement:



    int play()
    {
    bool ok=false;

    beaten=0;
    hp=10;
Results 1 to 25 of 105
Page 1 of 5 1 2 3 4