Search:

Type: Posts; User: rempas

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    96

    Because it doesn't work like that. UTF-8 unicode...

    Because it doesn't work like that. UTF-8 unicode (which is the most common) uses multiple codepoints for each character (other than the 128 ascii ones, hence why you can do something like this:...
  2. Replies
    3
    Views
    96

    How the compiler plays a role? I'm talking about...

    How the compiler plays a role? I'm talking about compilers for the same language? Aren't they produced the same code when it comes to data types?
  3. Yeah, sorry that sounded very wrong. I mean, it's...

    Yeah, sorry that sounded very wrong. I mean, it's not worth is FOR ME specifically. It is the best thing you can do if you are the type to spend your time and actually implement it. Fixed it ;)
  4. Replies
    4
    Views
    157

    Yeah, Tbh I though about it again and I probably...

    Yeah, Tbh I though about it again and I probably will support "const". Tbh, it's the same way with memory management. People forget, do mistakes, program late at night etc. So I suppose it's worth it!
  5. Replies
    4
    Views
    157

    I don't mean that. But still, it turns out that...

    I don't mean that. But still, it turns out that I'm a complete idiot because I thought that you could not pass "const" variables in "non-const" parameters even when they were passed by copy. I...
  6. Replies
    4
    Views
    157

    Is there any real reason to use "const"

    Rather than just tell the compiler to not allow me to modify a variable (like I don't know what I'm doing with my program), are there any reason to use "const" variables?

    Other than out of...
  7. That's nice! Tho I'm thinking that I'll probably...

    That's nice! Tho I'm thinking that I'll probably won't use it. It seems nice in theory but in action it doesn't worth it neither for learning nor
    implementing an actual assembler as there are a lot...
  8. Hahahaha! Yeah, I mean more practical way to...

    Hahahaha! Yeah, I mean more practical way to learn how the instructions translate to binary like a specification, official documentation or something.
    I mean, I just want to experiment and see. I...
  9. Hm, so the idea is that, I'll write a code...

    Hm, so the idea is that, I'll write a code snippet and see how it translates to binary for each instruction using these tools to read a binary file and see it in hex. That's cool. I would prefer...
  10. Hello! I'm sorry, I think it was more clear but...

    Hello! I'm sorry, I think it was more clear but it seems it wasn't.

    When saying create an elf executable (or library), I don't mean using a compiler. I mean actually creating them by myself by...
  11. Where can I learn how to create ELF executables?

    Is there a place where I can learn how to create an ELF executable (and the ELF format in general) in action? Please don't tell me things like "go read the source code of an assembler to see how they...
  12. Replies
    1
    Views
    149

    Can I use templates to add code in place?

    Is there a way to use templates to place code in place. What I want to do is mimic the behavior of "#define" but using C++ templates. So I want to do something like the following:



    #define...
  13. I don't know why but I run the code and I thought...

    I don't know why but I run the code and I thought It didn't gave me the right result for some reason but now that I run it, I get 1.

    And all that while I DO NOT do drugs. Imagine if I was doing....
  14. I did in my original code.

    I did in my original code.
  15. That's great however, just like I said, 0.n will...

    That's great however, just like I said, 0.n will not work. The value needs to be at least 1.0
  16. Yeah but why call another function and make it...

    Yeah but why call another function and make it run slower? Isn't my example working?
  17. If the value is negative or less that 1.0 (so for...

    If the value is negative or less that 1.0 (so for example: 0.388), it will not work. So you do something like that:



    bool negated = false; // To be used later to know if the value was...
  18. Thanks! It seems to work. I did something like...

    Thanks! It seems to work. I did something like the following:

    ```
    float val = 1384.838;
    int digits_before_dot = (unsigned int)log10(val);
    ```

    It will return 3 so I always have to add (1) to...
  19. How to find how many places from left the dot appears in a flot/double?

    Let's say that I have the following float/double: 137.837

    How can I find how many places from left the dot appears? So in this example I want to take either three or four (depending on how you...
  20. Thanks! They will come in handy! Tho I actually...

    Thanks! They will come in handy! Tho I actually implemented some more system calls in it seems that I was right and everything puts the returned value in "RAX" (in my system). So we are fine. Thanks...
  21. First of all, good job at using markdown style...

    First of all, good job at using markdown style syntax. It actually makes life much easier when trying to quote different parts of the post. Anyways, let's see

    > The same way you figure out which...
  22. Replies
    3
    Views
    406

    Hi! Ok so C is NOT an OOP language. C only...

    Hi! Ok so C is NOT an OOP language. C only supports the basic structure (called "struct"). This means only members for your struct and that's pretty much it. Below I will show you some examples and I...
  23. How would I know which registers are used for the returned value of a register?

    Again I want to use inline assembly with GCC. In my previous question I asked about clobbers, now I want to ask about the returned values from system calls.

    So let's consider the "write" system...
  24. Replies
    3
    Views
    292

    Yes, you should get an error if you use...

    Yes, you should get an error if you use "-fsanitize=address -O2 -Wall" with GCC. However, keep in mind that the compiler cannot check for values that contain non constant/literal values. This is why...
  25. Wow! If I was rating your reply, I would give you...

    Wow! If I was rating your reply, I would give you 10/10!!! Short explanations but fully detailed!

    So from what you are saying, I see this problem occurring only on loops (and of course in inline...
Results 1 to 25 of 61
Page 1 of 3 1 2 3