Search:

Type: Posts; User: yvan

Search: Search took 0.01 seconds.

  1. Replies
    6
    Views
    417

    and then use *scores, *(scores+1), *(scores+2) to...

    and then use *scores, *(scores+1), *(scores+2) to print it. cool! :cool:

    now I think the magic resides in the %s, and %c should be the same as %d.

    if we pass %s to read and write functions,...
  2. Replies
    6
    Views
    417

    I know that and Alex explained that as well: ...

    I know that and Alex explained that as well:


    But my question is beyond that whereby I'm trying to understand how it works when using different things such as plaint scores, &scores, scores[x],...
  3. Replies
    6
    Views
    417

    About arrays and strings

    Arrays in C - Cprogramming.com


    I tried this with integers instead of string to try understanding what's happening internally.




    #include <stdio.h>
  4. Thread: C or C++ ?

    by yvan
    Replies
    17
    Views
    1,601

    how do you measure efficiency ? I'm not talking...

    how do you measure efficiency ? I'm not talking amount code but speed time those things.
    --linesOfCode = ++abstraction
    too much abstraction not good when you want to learn or when you make...
  5. Thread: C or C++ ?

    by yvan
    Replies
    17
    Views
    1,601

    really ? you need recursion for example to solve...

    really ? you need recursion for example to solve some problems algorithmically or solve in more efficient way.
    do all programming languages support that ?
  6. Thread: C or C++ ?

    by yvan
    Replies
    17
    Views
    1,601

    very high-profile people you say ? it's possible...

    very high-profile people you say ?
    it's possible but why do they refuse to let it go?
    you will have to rewrite many high-profile systems like OS kernels, web servers and even programming/scripting...
  7. Replies
    5
    Views
    530

    Suppose I do this: printf("\n\t%c : %d %d",...

    Suppose I do this:


    printf("\n\t%c : %d %d", sptr[i], sptr, &sptr[i]);

    the first %d prints the address of the first char in the string but why does that work without & or why is that no...
  8. Replies
    5
    Views
    530

    I wrote that program and compiled it. I see no...

    I wrote that program and compiled it. I see no addresses when I remove the &, but I figured it out.
    It's 0x ascii value ! :cool:
  9. Replies
    5
    Views
    530

    [pointers] what does this program print?

    when you remove the & in this line:

    printf("\n\t%c : %p", sptr[i], sptr[i]); // sptr[i] and &sptr[i]

    my source code:



    #include <stdio.h>
    #include <stdlib.h>
  10. Replies
    2
    Views
    1,060

    I think some more and different kind of...

    I think some more and different kind of technologies.

    soms more: (x)html(5) with css for data representation and some client-side scripting with JavaScript when you want to do some validation...
  11. Thread: C or C++ ?

    by yvan
    Replies
    17
    Views
    1,601

    C or C++ ?

    C Tutorial - Learn C - Cprogramming.com


    I was reading about XNU kernel which is written in C and C++, so I was wondering why not just C++ if it's more modern and efficient and object oriented,...
  12. Replies
    13
    Views
    1,215

    dear Matticus, thank you for the answers and...

    dear Matticus,
    thank you for the answers and explanation but I get this feeling you are addressing me as if I am a developer of some real system/software, which is not the case because I am...
  13. Replies
    13
    Views
    1,215

    strlen() ! that is a good one. I have another...

    strlen() ! that is a good one.

    I have another program



    //an array of x cities whereby each city of y chars
    int x = 3;
    int y = 40;
    char cities[x][y];
  14. Replies
    13
    Views
    1,215

    thank you and yet, they say c is high level, it...

    thank you
    and yet, they say c is high level, it looks too low for me.
    any good book or www on "undefined behavior" when doing c?

    kr
  15. Replies
    13
    Views
    1,215

    now I see why some authors say you should use...

    now I see why some authors say you should use valgrind :wink:

    now, I tried something, on linux and windows.



    #include <stdio.h>
    #include <string.h>

    int main( int argc, char *argv[] ) {
  16. Replies
    13
    Views
    1,215

    the null terminating character

    I don't understand why this is working !

    I'm a bit confused because there's no room free in my "str" when the size of an input is greater than 4 !

    my code:


    #include <stdio.h>

    int main(...
  17. dear Matticus, thank you for the great comments....

    dear Matticus,
    thank you for the great comments. I updated the code, and I'm thinking now how and where to use some functions to reduce the size of main().

    I removed +=3 cause it's "rsp" not...
  18. My C game ! It's waiting your approval / disapproval

    https://upload.wikimedia.org/wikipedia/commons/thumb/6/67/Rock-paper-scissors.svg/2000px-Rock-paper-scissors.svg.png
    14672

    It is rock-paper-scissors game, of some sort ! :D

    It is one player...
  19. Replies
    2
    Views
    571

    dear laserlight, thank you! I see you are...

    dear laserlight,
    thank you! I see you are introducing new things to me, and I'm very glad with that.
    I think I've found another approach. I will start with a "game" that emerges as I learn more C....
  20. Replies
    2
    Views
    571

    To exit using return 1

    hi
    my nephew encouraged me to take some c lessons and here I am with my questions his way :redface: and also with my first steps in learning the c, I have now this program which prints a name...
Results 1 to 20 of 20