Search:

Type: Posts; User: MeNeedsHelp

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    13
    Views
    5,176

    @grumpy Hm. I suppose I'll try learning more...

    @grumpy
    Hm. I suppose I'll try learning more about that, then.

    Thank you for your help!
  2. Replies
    13
    Views
    5,176

    @grumpy Oh, I see. Thank you very much. ...

    @grumpy
    Oh, I see. Thank you very much.

    However, I'm still interested to know how to make the code be interpreted, and considering Lua did it in ANSI C, I'm very curious as to how to make it...
  3. Replies
    13
    Views
    5,176

    @grumpy OK, but how could I do that with...

    @grumpy
    OK, but how could I do that with something like Make from within the program?
  4. Replies
    13
    Views
    5,176

    @grumpy I don't need it to be interpreted, if I...

    @grumpy
    I don't need it to be interpreted, if I can do the "either that" option, but do you have an example of such a tool? As you said, IDEs like Visual Studio, Eclipse and NetBeans do this, so...
  5. Replies
    13
    Views
    5,176

    Sorry for being unclear. I'll try to give you a...

    Sorry for being unclear. I'll try to give you a decent example.

    Say a text file contains the following code:


    func<int> Add(int x, int y)
    { return (x + y); }

    structure Container
    { int i;...
  6. Replies
    13
    Views
    5,176

    I know how C "works". I just made an example, and...

    I know how C "works". I just made an example, and I meant for it to be interpreted not as C code, but as code for another imaginary language.


    void DoSomething(int* x) { (*x) = 42; }

    If you...
  7. Replies
    13
    Views
    5,176

    Interpreting code from file in C

    Hello.

    Say that a file contains the following text:


    struct Data { int x; };

    void DoSomething(int x) { x = 42; }

    int main()
  8. Replies
    22
    Views
    13,819

    All right, thank you for all the help. (I...

    All right, thank you for all the help.

    (I won't be asking any more questions here, so the thread can be locked.)
  9. Replies
    22
    Views
    13,819

    Even if I'm working with bits, is it fine to use...

    Even if I'm working with bits, is it fine to use a function to check if a bit is enabled? Wouldn't that slow the program down?
  10. Replies
    22
    Views
    13,819

    Oh. I think I understand now, thank you (and...

    Oh. I think I understand now, thank you (and sorry for taking up your time).

    EDIT:

    Slightly off-topic, but I don't really want to make a new thread just for this:
    Performance-wise, what is the...
  11. Replies
    22
    Views
    13,819

    0x01 = 0000 0001 0x02 = 0000 0010 0x04 = 0000...

    0x01 = 0000 0001
    0x02 = 0000 0010
    0x04 = 0000 0100

    However,
    0x03 = 0000 0011

    If I just want to switch the bit four times, I would just set "RADIO_ENABLED" to 3 rather than 0x03. If I do it...
  12. Replies
    22
    Views
    13,819

    OK... // Base.h #define LIGHT_ENABLED...

    OK...



    // Base.h
    #define LIGHT_ENABLED 0x01
    #define ENGINE_ENABLED 0x02
    #define RADIO_ENABLED 0x04
    #define AC_ENABLED 0x08
  13. Replies
    22
    Views
    13,819

    I assume you missed my edit, since it wasn't in...

    I assume you missed my edit, since it wasn't in the quote. My question was (initially, at least) poorly phrased.
  14. Replies
    22
    Views
    13,819

    In that case, how would you enable, disable,...

    In that case, how would you enable, disable, toggle and check if a bit is enabled?

    I use this code:


    #define EnableBit(var, pos) ((var) |= (1 << (pos - 1)))
    #define IsBitEnabled(var, pos)...
  15. Replies
    22
    Views
    13,819

    So, if I've understood it correctly, it can be...

    So, if I've understood it correctly, it can be used as follows:


    // Base.h
    #define ENABLE_LIGHT 0x01 // 0000 0001
    #define ENABLE_ENGINE 0x02 // 0000 0010

    // Main.c
    unsigned char settings...
  16. Replies
    22
    Views
    13,819

    Bit fields and hex

    Hello!

    When studying OpenGL, I noticed that constants are defined as such:



    #define GL_CONSTANT_1 0x01 // 1 = 00000001
    #define GL_CONSTANT_2 0x02 // 2 = 00000010
    #define GL_CONSTANT_3 0x04...
  17. Replies
    12
    Views
    2,979

    Thank you, I'll do that.

    Thank you, I'll do that.
  18. Replies
    12
    Views
    2,979

    I am doing this for a project, just to learn. If...

    I am doing this for a project, just to learn. If I wanted the best, I would use something like Python.

    I mean, is it possible to compile with GCC without having the user do it themselves - for...
  19. Replies
    12
    Views
    2,979

    Could I do it if GCC is installed? (MinGW, in...

    Could I do it if GCC is installed? (MinGW, in this case.) If so, how?
  20. Replies
    12
    Views
    2,979

    Is there a way to compile it within the program...

    Is there a way to compile it within the program itself? What I want to do is to open a text file with instructions, turn it into C code and then compile it into an executable. I understand how to do...
  21. Replies
    12
    Views
    2,979

    Nested functions for a "new language"

    I am currently trying to make a "new programming language" (the term used VERY loosely) based on C. To do this, I decided to use C to read strings and interpret their contents.


    void Read()
    {
    ...
  22. Replies
    15
    Views
    6,056

    Apparently, I'm not wrong, at least when it comes...

    Apparently, I'm not wrong, at least when it comes to variables being placed before any other code - it works fine in VS13E.

    Thank you for the help.
  23. Replies
    15
    Views
    6,056

    If I've understood it correctly, VS 2013 Express...

    If I've understood it correctly, VS 2013 Express should be able to compile C99 code. Am I wrong?
  24. Replies
    15
    Views
    6,056

    Oh, I see. Is there no way to use C99 or C11 with...

    Oh, I see. Is there no way to use C99 or C11 with VS?
  25. Replies
    15
    Views
    6,056

    That doesn't work - since num is given a value...

    That doesn't work - since num is given a value only after ex is created, it doesn't carry over, which is the whole point.
Results 1 to 25 of 26
Page 1 of 2 1 2