User Profile

Collapse

Profile Sidebar

Collapse
333471
333471
Last Activity: Jul 7 '14, 06:09 AM
Joined: Jun 30 '14
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • 333471
    started a topic empty structure in C
    in C

    empty structure in C

    Can a blank struct b declared
    · Can an array of blank struct b declared
    · If yes what does a[3] point to
    See more | Go to post

  • 333471
    started a topic pointer array
    in C

    pointer array

    Code:
    char *s="george";
    printf(" from s %s\n",s);
    
    s[0]='k';
    
    printf(" from new s %s\n",s);
    
    char p[]="john";
    printf("from p %s\n",p);
    
    p[2]='k';
    
    printf(" from new p %s\n",p);

    plss explain me how dis actually works inside the memory?
    1)s is just a pointer holding...
    See more | Go to post

  • 333471
    replied to C pointers with char array
    in C
    im still confused...in both cases it was call by value...so den it shud nt reflect the changes...but in the second case its reflecting it(the 's' was neymar messi and not 'nekmar messi')
    See more | Go to post

    Leave a comment:


  • 333471
    started a topic C pointers with char array
    in C

    C pointers with char array

    Code:
    void func(char *s)
    {
    s+=1;
    }
    void main()
    {
    char s[]="neymar messi";
    func(s);
    printf("%s",s);
    }
    Above program shud have gvn me eymar messi ryt?
    but its showing 's' as it is...y?

    But in this case the output is nekmar messi....
    Code:
    void func(char *s)
    {
    s[2]='k';
    }
    void main()
    {
    ...
    See more | Go to post
No activity results to display
Show More
Working...