1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hi Everyone

Discussion in 'Meet and Greet' started by Peter_Aye, Jan 3, 2011.

  1. Peter_Aye

    Peter_Aye New Member

    Joined:
    Dec 31, 2010
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    Unijos
    Hi!
    I'm peter, and I am so glad to have joined this forum. I'm a programming fan, though I'm still relatively new to the stuff. I will be needing help, 'cos i'm into writing little pieces of code for just basic stuf like prime no.s, factorial, and stuff like that. Thanks anyway! Expect to enjoy this forum greatly.:)
     
  2. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    1
    Trophy Points:
    0
    Hi and welcome to the forum
     
  3. chaithra kashyap

    chaithra kashyap New Member

    Joined:
    Jan 3, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    :) iam a computer science student.....n piliz i need a guide for c++ from basics... n wana b xpert in dis programming language.....so plz guide me....
     
  4. Peter_Aye

    Peter_Aye New Member

    Joined:
    Dec 31, 2010
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    Unijos
    Though I am still new to the programming world, I learn a lot through reading ebooks on programming and many are available online. I have some really good ones and you can log on to freetechbooks.com for others, or search for "Begining Visual C++ 2008" by Ivor Horton. It's a really good book and it treats the basics so well. Happy programming!
     
  5. gagandeep1

    gagandeep1 New Member

    Joined:
    Jan 23, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    i am also a begginner. can we help each other ?
     
  6. gagandeep1

    gagandeep1 New Member

    Joined:
    Jan 23, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    i am computer science student and want to be expert in c++ programming . can you help me ?:person:
     
  7. chaithra kashyap

    chaithra kashyap New Member

    Joined:
    Jan 3, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    hello gagan....
    sure ....we can help each other....i think its the best way...to gain knowledge... e1 i need a proper guide from basics....
     
  8. Peter_Aye

    Peter_Aye New Member

    Joined:
    Dec 31, 2010
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    Unijos
    Yeah, we can help each other. Just post your questions and i'll post mine, and we can help each other. I look forward to being of help to you.
     
  9. Peter_Aye

    Peter_Aye New Member

    Joined:
    Dec 31, 2010
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    Unijos
    There's this wrox ebook by Ivor horton which i have and which is available online. I can upload it if you want.
     
  10. chaithra kashyap

    chaithra kashyap New Member

    Joined:
    Jan 3, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    can anybody explain the o/p of the following...
    void main()
    {
    char s[]="man";
    int i;
    for (i=0;s;i++)
    printf("\n%c%c%c%", s,*(s+i),*(i+s),i(s));
    }

    output : mmmm
    aaaa
    nnnn
     
  11. Rakesh Kumar Pahwa

    Rakesh Kumar Pahwa New Member

    Joined:
    Jan 13, 2011
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    0
    Hi Chaitra,

    What is that you didn't understood in this code snippet..?
     
  12. Peter_Aye

    Peter_Aye New Member

    Joined:
    Dec 31, 2010
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    Unijos
    I think I understand the first 3/4 lines of the program, which are just initialization of the variable i of type integer with a value of zero, the variable s of type string with the value "man", and then the definition of the for loop with variable i of start value 0, stop value, the ith character of the string (not too sure about this) and increments of 1. What beats me is this line:

    printf("\n%c%c%c%", s,*(s+i),*(i+s),i(s));

    Maybe others can enlighten us about it. That's the best I can do... Good luck!
     
  13. Rakesh Kumar Pahwa

    Rakesh Kumar Pahwa New Member

    Joined:
    Jan 13, 2011
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    0
    Hey Peter,

    This is nothing but different naming conventions. You can write s in the given formats. It is one of the same thing.
     
  14. Peter_Aye

    Peter_Aye New Member

    Joined:
    Dec 31, 2010
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    Unijos
    Rakesh,
    Could you please be a little clearer? I don't catch your drift.
     
  15. Rakesh Kumar Pahwa

    Rakesh Kumar Pahwa New Member

    Joined:
    Jan 13, 2011
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    0
    Peter,

    In my opinion s,*(s+i),*(i+s),i(s) all are same. as s is internally treated as *(s+i). it means if s is at location 4000 in memory and it's an integer array, and suppose int takes 2 bytes and value of i is 2. now, first expression s will be evaluated as *(4000+4) = value at loc 4004. second expression *(s+i) will evaluate in same way *(4000+4). now *(i+s) will become *(4+4000) = value at 4004. similarly i(s) becomes *(i+s) i.e. *(4+4000)= value at 4004.
     
  16. Peter_Aye

    Peter_Aye New Member

    Joined:
    Dec 31, 2010
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    Unijos
    Thanks a lot for that, Rakesh. There's on part though that is still mind boggling. What does "\n%c%c%c%" mean? And does the s part have anything to do with the Left$(A$, n) in Visual basic/Basic?
     
  17. Rakesh Kumar Pahwa

    Rakesh Kumar Pahwa New Member

    Joined:
    Jan 13, 2011
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    0
    Hey Peter,

    "\n%c%c%c%" does not mean anything. It's merely a humar error. I think author missed to write "c" after last "%". And dude I don't know anything about Visual Basic, so i would not be able to answer ur second query...
     
  18. carsten4

    carsten4 New Member

    Joined:
    Mar 7, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Home Page:
    Hey friends, this is the very good idea to learn programming with the helping of each other. I like to do programming so it is my pleasure to join you. So be ready to help anybody and anytime.
     

Share This Page