P
Pallav singh
In the Given below code Does case const-expression: do not have anny
effect on do ...while(); loop
Thanks
Pallav Singh
#include<stdio.h>
#include<stdlib.h>
int main()
{
char to1[] ="Pallav";
char from1[] = "Puneet";
char *to = to1;
char *from = from1;
int count = 21;
printf("Value in to is %s \n\n",to);
printf("Value in from is %s \n\n",from);
register n = (count + 7) / 8; /* count > 0 assumed */
switch (count % 8)
{
case 0: do { *to = *from++;
case 7: *to = *from++;
case 6: *to = *from++;
case 5: *to = *from++;
case 4: *to = *from++;
case 3: *to = *from++;
case 2: *to = *from++;
case 1: *to = *from++;
} while (--n > 0);
}
printf("Value in to is %s \n\n",to);
return 0;
}
effect on do ...while(); loop
Thanks
Pallav Singh
#include<stdio.h>
#include<stdlib.h>
int main()
{
char to1[] ="Pallav";
char from1[] = "Puneet";
char *to = to1;
char *from = from1;
int count = 21;
printf("Value in to is %s \n\n",to);
printf("Value in from is %s \n\n",from);
register n = (count + 7) / 8; /* count > 0 assumed */
switch (count % 8)
{
case 0: do { *to = *from++;
case 7: *to = *from++;
case 6: *to = *from++;
case 5: *to = *from++;
case 4: *to = *from++;
case 3: *to = *from++;
case 2: *to = *from++;
case 1: *to = *from++;
} while (--n > 0);
}
printf("Value in to is %s \n\n",to);
return 0;
}