Search:

Type: Posts; User: elsparko

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    4
    Views
    1,397

    Do you mean a second array that fills up with...

    Do you mean a second array that fills up with numbers as the loop progresses and then uses those numbers to name the variables? Like this



    string[] arraynames = new string[2];...
  2. Replies
    4
    Views
    1,397

    Naming a variable with another variable

    I'm trying to create a loop that will create some variable as it goes through and then add the variables to an array. I want to name the variables created based on their position in the array,...
  3. Class not seeing its avaliable attributes

    Hi again

    one of my classes operations keeps throwing up errors saying it can't find data it should be able too.

    the operation is AISnake::check_collision( ); and it is a friend of the food...
  4. your right, it should be 'canvas' rather than...

    your right, it should be 'canvas' rather than 'Canvas'. thanks

    the only problem is, it now can't find canvas :-S

    going to have to figure out how to pass canvas along the functions to reach...
  5. primary expression error when calling operation

    Hi again

    Whenever I try and call the function of my food class I get the error

    expected primary-expression before ')' token

    heres the operation being called


    food::draw_food(Canvas);
  6. Replies
    0
    Views
    892

    putting it in the friend zone

    Hi again.

    I want a operation in one of my classes (Snake) to be able to use the attributes of another class (food), so I want to declare that operation as a friend of food.

    I'm still new and...
  7. problem solved I added default values to the...

    problem solved

    I added default values to the position structure and now it works like a charm

    thanks for all the help everybody
  8. erm, ok here's the header file for the food...

    erm, ok

    here's the header file for the food class



    class food {

    //Attributes
  9. Well I changed the food constructor to this ...

    Well I changed the food constructor to this


    food::food(int x = 0, int y = 0)
    {
    ImageFile("../Assets/node3.tga").load(foodImage_);
    }


    I'm still getting the same error, but...
  10. Constructor being called in another constructor compiler error

    Hi again.

    I'm getting a strange compiler error that I just can't figure out how to fix.

    the error reads

    error: no matching function for call to ‘Position::Position()’

    heres some of the...
  11. Replies
    9
    Views
    1,213

    Ok, I've done some reading, but now I'm not sure...

    Ok, I've done some reading, but now I'm not sure if iterators can even be used in an array.

    All the examples I've read only use iterators with lists and vectors from the STL.

    can they be used...
  12. Replies
    9
    Views
    1,213

    Ok, I've done away with the whole iterator thing...

    Ok, I've done away with the whole iterator thing and now I haev this



    void food::draw(Canvas &canvas)
    {
    for (prog = foodpositions_[prog]; prog != foodpositions_[5];...
  13. Replies
    9
    Views
    1,213

    foodpositions_[ ]is an array of 5 structures that...

    foodpositions_[ ]is an array of 5 structures that hold two ints.

    its declared elsewhere in the code, heres a looky



    //decleration of position

    struct Position
    {
  14. Replies
    3
    Views
    1,043

    setting up inheritance

    Hi again,

    I'm trying to set up some inheritance between some classes that I've already written.

    There are two classes, Snake (parent class) and AISnake (derived class). here are their current...
  15. Replies
    9
    Views
    1,213

    problem with iteratiors

    Hi there

    I'm having trouble with an iterator, I have used them very often so I'm not sure why i'm getting the error

    heres my code


    void food::draw(Canvas &canvas)
    {
    ...
  16. Replies
    5
    Views
    1,054

    Ok, i've changed the code to what I think you...

    Ok, i've changed the code to what I think you wanted me too, the structure now looks like this.


    struct Basecard
    {
    struct _persons //structure that holds the names
    {
    char...
  17. Replies
    5
    Views
    1,054

    calling structures within structures

    Hi again.

    I've got this program that's supposed to generate Christmas cards. it does this using hard coded information and information given by the user.

    it uses the following stucture at its...
  18. Replies
    7
    Views
    1,134

    No, I haven't assigned x or y to anything in the...

    No, I haven't assigned x or y to anything in the .hpp file. I'm sorry I should probably have posted both the .hpp and .cpp versions on the constructor.

    Although this was something I did earlier in...
  19. Replies
    7
    Views
    1,134

    I already had the header guards in when he told...

    I already had the header guards in when he told me to add them ;-)

    anyway, heres the AISnake constrructor


    AISnake::AISnake(int x = 0, int y = 0)
    {
    ...
  20. Replies
    7
    Views
    1,134

    Thats exactly what my tutor told me, but I am...

    Thats exactly what my tutor told me, but I am using header guards.

    I have the following guards in their respective files


    #ifndef SNAKE_HPP_INCLUDED
    #define SNAKE_HPP_INCLUDED

    {code}
  21. Replies
    7
    Views
    1,134

    #include problem

    Hi there,

    I'm writing a simple snake game for a uni course, and I'm having a little trouble linking all the files together

    I have 3 classes (Snake, AISnake and GameEvent) and a structure...
  22. Replies
    1
    Views
    999

    semantics question

    hi there

    I'm looking for a bit of semantics help. I know what I want to do, but don't know what its called so I can't really learn how to do it :P

    I have four classes:

    Snake
    PlayerSnake...
  23. Thread: 3D array

    by elsparko
    Replies
    5
    Views
    1,261

    *face palms* of course! I see it now, I knew it...

    *face palms* of course! I see it now, I knew it would be something simple/stupid

    you'll have to forgive me, I'm not used to spotting these little errors yet, but I'm still learning.

    Anyway,...
  24. Thread: 3D array

    by elsparko
    Replies
    5
    Views
    1,261

    3D array

    Anyone that's seen one of my previous posts over the past few days , most of that stuff has now been scrapped as I thought we needed to have an uninitialized array, but it turns out we don't.
    ...
  25. Replies
    2
    Views
    1,601

    thanks for the replies, since I'm new to C++ I...

    thanks for the replies, since I'm new to C++ I wasn't sure if what I was thinking was something I could do.

    what I was trying to show in the second pseudo block was a loop where the name of the...
Results 1 to 25 of 27
Page 1 of 2 1 2