Pointer and String
in line 10, this program will be output '3D Street N0.5'. How to make the output become 'Sesame Street No.5'? please help
1 2 3 4 5 6 7 8 9 10 11 12
|
#include<stdio.h>
int main()
{
char name[] = "Dion";
char *Address= "Sesame 3D Street No.5";
printf("Name = %s\n", name);
printf("Address = %s\n", address);
address+=7;
printf("Name = %s\n", name);
printf("Address = %s\n", address);
}
|
Line 8 changes what character address
(should be Address
?) points to. Was that line supposed to do something else?
Last edited on
Topic archived. No new replies allowed.