Re: How is memory allocated

Discussion in 'C Programming' started by Martin Ambuhl, Jun 27, 2003.

  1. (Samuel Thomas) wrote (27 Jun 2003) in
    news: / comp.lang.c:

    > Hello Everybody,
    >
    > Could you please go through the code I wrote and help me with my
    > doubts?



    Please compare your code (on the left) to a slightly modified
    version on the right. And there is no such thing as pass-by-reference in
    C.

    #include <stdio.h> #include <stdio.h>
    #include <conio.h> <

    void printnamefirst(char[]); | void printnamefirst(void);
    void printnamesec(char[]); void printnamesec(char[]);

    void main() | int main()
    { {
    clrscr(); | printnamefirst();
    printnamefirst(name); | return 0;
    } }

    void printnamefirst(char nm[]) | void printnamefirst(void)
    { {
    char nam[20] ="Samuej Thomas"; char nam[20] = "Samuej Thomas";
    printnamesec(nam); printnamesec(nam);
    printf("%s \n",nam); printf("%s \n", nam);
    } }

    void printnamesec(char ns[]) void printnamesec(char ns[])
    { {
    printf("%s \n",ns); printf("%s \n", ns);
    ns[5]='l'; ns[5] = 'l';
    } }





    --
    Martin Ambuhl
    Returning soon to the
    Fourth Largest City in America
     
    Martin Ambuhl, Jun 27, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Duncan
    Replies:
    0
    Views:
    406
    Duncan
    Jul 21, 2003
  2. Laura Heinzmann

    How to check memory size allocated to JVM?

    Laura Heinzmann, Feb 16, 2005, in forum: Java
    Replies:
    1
    Views:
    8,233
    John McGrath
    Feb 16, 2005
  3. Kjell Arne Johansen

    How do I know if memory is already allocated?

    Kjell Arne Johansen, Sep 1, 2003, in forum: C++
    Replies:
    8
    Views:
    406
    Kjell Arne Johansen
    Sep 2, 2003
  4. C++fan
    Replies:
    4
    Views:
    1,781
    Jack Klein
    Jan 7, 2004
  5. Replies:
    5
    Views:
    668
    Matt Wharton
    Dec 9, 2004
Loading...

Share This Page