Search:

Type: Posts; User: koplersky

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds; generated 37 minute(s) ago.

  1. Replies
    4
    Views
    1,266

    Great, thanks Soma. I was failing to see how...

    Great, thanks Soma. I was failing to see how constexpr references could be different.

    As for the auto, I had it the other way around anyway, so problem solved. :)
  2. Replies
    4
    Views
    1,266

    Thanks laserlight. I did check the standard, but...

    Thanks laserlight.
    I did check the standard, but it didn't help much concerning the constexpr doubt. But I'm afraid that's not a bug; I'm reading C++ Primer and it says that one can bind references...
  3. Replies
    4
    Views
    1,266

    constexpr and auto references

    I have some doubts about constexpr and auto when applied to references.

    From what I've read, constexpr imposes top-level const. In that case, what's the effect of doing:


    constexpr int &ref =...
  4. Replies
    38
    Views
    6,100

    Alright, thank you guys for the answers! ;)

    Alright, thank you guys for the answers! ;)
  5. Replies
    38
    Views
    6,100

    To throw or not to throw

    This is something that I've been curious about.

    What's your opinion about exceptions? Do you usually use them in your programs (those where you can write code as you like and are not tied to some...
  6. Replies
    2
    Views
    3,087

    Isn't the extra character a 1 and not a 4? The...

    Isn't the extra character a 1 and not a 4?

    The problem is that you are not checking the return value of fgets(). From the linked page:



    You probably have a newline at the end of your input....
  7. Replies
    6
    Views
    1,283

    That's it, thank you laserlight!

    That's it, thank you laserlight!
  8. Replies
    6
    Views
    1,283

    Get matrix indexes from the value

    Hello,

    I have a 3x3x3 matrix with values hanging from 1 to 27.
    The order is this:

    m[0][0][0] = 1;
    m[0][0][1] = 2;
    m[0][0][2] = 3;
    m[0][1][0] = 4;
    m[0][1][1] = 5;
  9. Thread: Memory in C

    by koplersky
    Replies
    3
    Views
    749

    Memory in C

    This might be a silly question, but how does memory address work in C?

    I know that in most architectures an int takes 4 bytes in memory, while a char takes 1 byte. But how does the program know...
  10. Replies
    6
    Views
    1,239

    Thanks everybody and sorry for the...

    Thanks everybody and sorry for the misinterpretation. ;)
  11. Replies
    6
    Views
    1,239

    Sorry, I misunderstood that part. So my...

    Sorry, I misunderstood that part.

    So my compiler returning how bigger or how smaller the value is, is just a plus and not a guaranteed result?
  12. Replies
    6
    Views
    1,239

    strcmp return value on different compilers

    Hello there, I'm having a problem with the strcmp return value. My compiler returns the correct value based on my research, but I tried to compile the code below on those online compilers and the...
  13. Replies
    9
    Views
    1,101

    Oh, very nice, didn't know it could be used that...

    Oh, very nice, didn't know it could be used that way.
    Thanks!
  14. Replies
    9
    Views
    1,101

    Sorry, but I've never seen an if clause being...

    Sorry, but I've never seen an if clause being used to test an expression like this.
    How does it work?
  15. Replies
    6
    Views
    3,659

    Ok, thank you Malcolm.

    Ok, thank you Malcolm.
  16. Replies
    6
    Views
    3,659

    I was thinking about doing this on my own but I...

    I was thinking about doing this on my own but I thought there was some standard library function to do that.
    Thank you guys for the suggestions and for the help!
  17. Replies
    6
    Views
    3,659

    Print string with escape characters

    Hello there,

    This may be a silly question, but is there any function to print a string with all the escape characters in it?

    For example, instead of printing:
    This is a string.

    It would...
  18. Replies
    3
    Views
    1,134

    Is there a function prototype for list_dir before...

    Is there a function prototype for list_dir before this?
    If so maybe it's different from the function definition.
  19. Replies
    10
    Views
    1,240

    This is because you have declared the array as...

    This is because you have declared the array as int nums[10], and you are trying to print an element which is not in the array (nums[10]).
    Here's the problematic line:

    printf("%d\n",nums[10]);
  20. Thread: Struc Array

    by koplersky
    Replies
    11
    Views
    1,312

    Yes, it's just a bad habit of mine. But you are...

    Yes, it's just a bad habit of mine. But you are right, thanks for the fix.
  21. Replies
    14
    Views
    2,080

    I see, so the difference in performance is not...

    I see, so the difference in performance is not that much.

    Thank you for the answers, and specially Adak for the fine sample code.
  22. Thread: Struc Array

    by koplersky
    Replies
    11
    Views
    1,312

    The problem is with this line: ...

    The problem is with this line:


    scanf("%c",a[i].fakulti);

    Change it to:


    scanf("%c", &(a[i].fakulti));
  23. Thread: Struc Array

    by koplersky
    Replies
    11
    Views
    1,312

    Try putting the prototype of these functions...

    Try putting the prototype of these functions before main.

    int read_data(struct stud a[], int n);
    int search_data( struct stud a[], int n , int sid);

    And never declare main as returning void,...
  24. Replies
    14
    Views
    2,080

    And from this casual comment I learned a new...

    And from this casual comment I learned a new technique, or at least the concept of something I had already done. ;)
  25. Replies
    14
    Views
    2,080

    The way I understood it was that calling...

    The way I understood it was that calling functions would make the program run slower, that's why recursion came to my mind.

    Click_here this example is indeed interesting, because when I first...
Results 1 to 25 of 58
Page 1 of 3 1 2 3