Search:

Type: Posts; User: Maor Elbaz

Search: Search took 0.00 seconds.

  1. Replies
    3
    Views
    7,247

    count characters in input

    can someone explain to me why I don't get an output running the following code:

    #include <stdio.h>/* count characters in input; 2nd version */
    main()
    {
    double nc;
    for (nc = 0;...
  2. Replies
    4
    Views
    1,963

    I changed it to pointer and it worked. text...

    I changed it to pointer and it worked.
    text itself is a pointer so why can't I use it?
    when writing --> text = text+1; I'm changing the memory address that text contains, I'm causing it to point...
  3. Replies
    4
    Views
    1,963

    changing a string of text value

    why can't I run this?

    char text[]="nave"; char *pointer=text;
    if(*text='n'){


    printf(" \n the string equal to: %s",pointer);
    *text='m';...
  4. thanks for your replies

    thanks for your replies
  5. why does it result in undefined behavior?

    why does it result in undefined behavior?
  6. Change string literal in C through pointer?

    is it possible to run this code?

    #include <stdio.h>

    int main(void) {

    char *my_string="Hello";
    printf("%s",my_string);
    *my_string='w';
    printf("%c",my_string);
  7. Replies
    3
    Views
    1,049

    Okay, thanks

    Okay, thanks
  8. Replies
    3
    Views
    1,049

    question about basic programming

    there's something that I dont understand
    how can you print a string using a pointer? what is the logic standing behind it?
    like for example in the following code:

    #include <stdio.h>


    int...
  9. Replies
    1
    Views
    2,692

    question about basic programming

    when running the following code, why do I get two different memory addresses?

    #include <stdio.h>


    int main(void){


    int short signed number=-3;
    int short signed *pointer=&number;
  10. Replies
    3
    Views
    1,874

    Thanks for the explanation

    Thanks for the explanation
  11. Replies
    3
    Views
    1,874

    question about basic programming

    Hi,
    I'm learning C programming language at the moment.

    Just out of curiosity what happens if the place holder and the argument is not compatible?
    for example if I write: printf("some text %d,...
Results 1 to 11 of 12