Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I am analyzing a C++ console based program but I am very newbie to C++ and I want to learn it. Main reason, why I am analyzing this code, becouse I need to remake it by myself but in form of MFC dialog.
Okay, I have couple of questions and I hope, someone will help me...
1) Does this one makes an array? If so, then, all the array values from 1..32 will be empty, if I call set or any other?
2) What will I get, when I will call just: "set", not "set[n]" ?
3) What will I get, when I will say "set+k" if:
4) What is doing this loop? I know that "EOF" is EndOfFile that is CTRL+Z, but what this loop does?
[code]while (k<32 && scanf("%d",set+k)!=EOF) k++;[/code]
5) What is doing here:
[code]for (i=0;i<k-1;i++) printf("%d,",set[i]);[/code]
6) What this will "set[k-1]" print out?
[code]if (k) printf("%d",set[k-1]);[/code]
Okay, (not a)full code, if you ask, is here:
[code]int main(void) /*demo*/
printf("enter the set elements separated by blanks and ctrl-z at the "
while (k<32 && scanf("%d",set+k)!=EOF) k++;
for (i=0;i<k-1;i++) printf("%d,",set[i]);
if (k) printf("%d",set[k-1]);
I will have a couple of more questions later on...
0 · ·