Search:

Type: Posts; User: Justin H

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Thanks! I really appreciate the replies, and...

    Thanks! I really appreciate the replies, and definitely understand it a bit more. Thanks. :)
  2. Quick question about winAPI resource files & icons

    Tutorial: Using Resources

    The above tutorial has some very nice explanations and I feel pretty good with the content it taught me; however, one thing I'm not too clear on is:

    1) What are these...
  3. Thread: **argv

    by Justin H
    Replies
    2
    Views
    733

    Ah, can't believe I missed that. Thanks for the...

    Ah, can't believe I missed that. Thanks for the quick & helpful reply. :)
  4. Thread: **argv

    by Justin H
    Replies
    2
    Views
    733

    **argv

    I've noticed when reading through some winAPI tutorials. May I ask why there's two * instead of just one?
  5. Replies
    3
    Views
    1,203

    Ah, thank you. I guess I just got a little...

    Ah, thank you. I guess I just got a little confused on what I was wanting to do there.

    Your example is actually what I wanted to do. Thanks.
  6. Replies
    3
    Views
    1,203

    Calling function from its memory address?

    I searched the internet for a method of doing this, and came across this neat little trick:



    typedef void func(void);
    func* f = (func*)0xdeadbeef;
    f();


    And I'm a little stuck here on...
  7. Replies
    2
    Views
    2,232

    Default value for function parameter

    function declaration


    void gui::addMenuButton(int x, int y, string name, int parent = -1){

    prototype


    void addMenuButton(int x, int y, string name, int parent = -1);
  8. Replies
    2
    Views
    905

    Aha, never mind. I understand now. Can't believe...

    Aha, never mind. I understand now. Can't believe I didn't figure that one out. >.<

    It's:



    gui.didClickButton(&sf::Mouse::getPosition());


    Thanks. ^.^
  9. Replies
    2
    Views
    905

    Why can't I do the second method?

    Working method:



    sf::Vector2i *position = &sf::Mouse::getPosition();
    gui.didClickButton(position);

    Now, that works just fine. But, why can't I just do:
  10. Replies
    8
    Views
    978

    Which method is more efficient?

    I'm keeping a account of the # of buttons created in my program. And from several places that # is used to pull data from a vector, etc.

    Is it more efficient to to increment an integer with the #...
  11. Replies
    12
    Views
    1,209

    Ah, makes complete sense. Thanks. :)

    Ah, makes complete sense.

    Thanks. :)
  12. Replies
    12
    Views
    1,209

    Aha, thanks. This is a nice little feature. ;) ...

    Aha, thanks. This is a nice little feature. ;)

    However, does this act just like a pointer? It's just not technically labeled as one?..
  13. Replies
    10
    Views
    1,323

    Yes, g is the object. It can be named whatever,...

    Yes, g is the object. It can be named whatever, so long as you refer to that same object name throughout the code.

    e.g:


    int main()
    {
    TicTacToe wowthisisanobject;
    ...
  14. Replies
    12
    Views
    1,209

    The first code you provided worked fine without...

    The first code you provided worked fine without any errors.

    However, may I ask why you moved the address symbol (&)? (from the return statement to the function type information)

    Thanks.
  15. Replies
    12
    Views
    1,209

    How would I return it normally is my main...

    How would I return it normally is my main question. :confused:



    void notepad::retrieveButtons(){
    return &buttons;
    }
  16. Replies
    12
    Views
    1,209

    Class function return type

    vector<sf::Text> notepad::retrieveButtons(){

    }

    As you can see, I'm trying to let the computer know that the notepad class has a function retrieveButtons, and that the function will return a...
  17. Thread: Odd error

    by Justin H
    Replies
    2
    Views
    1,108

    Thank you! Simple mistakes on my part. ^.^ ...

    Thank you! Simple mistakes on my part. ^.^

    Revised and working code:



    #include <SFML/Graphics.hpp>
    #include <iostream>
    #include <string>
  18. Thread: Odd error

    by Justin H
    Replies
    2
    Views
    1,108

    Odd error

    I feel as if I have correctly setup my pointer and addresses within te arguments, but that's more than likely where I'm going wrong.

    Quick question: Do you need the text object to be a pointer in...
  19. Quick question regarding overloading operators

    // vectors: overloading operators example
    #include <iostream>
    using namespace std;


    class CVector {
    public:
    int x,y;
    CVector () {};
    CVector (int,int);
  20. Replies
    7
    Views
    1,459

    Ah, I guess that slipped away from me and I never...

    Ah, I guess that slipped away from me and I never really caught that.

    Thanks for the reply. ;)



    Thank you for the provided concept!

    Worked perfectly.
  21. Replies
    7
    Views
    1,459

    Always player #1's turn?

    After reviewing the below code for the past hour, I cannot seem to figure out this problem.

    This is a basic WIP for a tic-tac-toe game (I'm new to C and thought this would be a decent little...
  22. Woops...

    Woops...
  23. printf("3 %c", (isEven(4)) ? 'Y' : 'N'); I'm...

    printf("3 %c", (isEven(4)) ? 'Y' : 'N');

    I'm using that to test the function:



    int isEven(int x){
    return !(x%2);
    }
  24. More efficient way to structure this function?

    I have the very basic function below:



    int isEven(int x){
    return ((x%2) == 0) ? 1 : 0;
    }


    I was recommended to use something related to booleans to further improve this function,...
  25. Yeah, I wasn't aware of all the string functions...

    Yeah, I wasn't aware of all the string functions C had available. I'll definitely be looking into them. :)
Results 1 to 25 of 32
Page 1 of 2 1 2