-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhellow.c
36 lines (30 loc) · 821 Bytes
/
hellow.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include<stdio.h>
int main()
{
char Name[50]="Yu-Hsun Lee";
int i = 0;
// Name is a fixed char vecter
// Name[0], Name[1], Name[2], ..., Name[49]
// Name[0]=Y
// Name[1]=u
// Name[2]=-
// Name[3]=H
// ...
// Name[11]=\0
printf( "hellow world!\n" );
printf( "%d\n" ,2+3 ) ; // %d print an integer
printf( "%s\n" ,Name ) ;
printf( "%c\n" ,Name[5] ); // Name[5] = u
printf( "%s\n" ,Name+3);
printf( "%s\n" ,Name-3);
printf( "%u\n" ,Name) ; // Name -> 2686720
printf( "%u\n" ,Name+3) ; // Name+3 -> 2686723
// %u print unsigned integer (positive integer)
// %d print integer
for ( i ; i<50 ; i++)
{
printf( "%d:%c-%u\n", i, Name[i], Name[i]) ;
}
system("pause") ;
return 123 ;
}