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.
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....
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!
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....
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.
There's this wrox ebook by Ivor horton which i have and which is available online. I can upload it if you want.
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
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!
Hey Peter, This is nothing but different naming conventions. You can write s in the given formats. It is one of the same thing.
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.
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?
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...
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.