Skip to content

Commit

Permalink
添加README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nawbaby committed Aug 10, 2020
1 parent 96ac186 commit 7dea091
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 23 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
###c/c++练习的文件库,存放在git做收集
Binary file modified a.out
Binary file not shown.
9 changes: 9 additions & 0 deletions getopt.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <stdio.h>
#include<unistd.h>
#include<time.h>
  int main(int argc, char *argv[])
{
clock_t t1,t2;
t1 = clock();
sleep(5);
}
50 changes: 27 additions & 23 deletions kanbudong.c
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
#include <stdio.h>
#include <string.h>
1 #include <stdio.h>
2 #include <string.h>
3
4
5 const char g_ip[32] = "123456789";
6 int func1(const char *ip)
7 {
8 printf("ip:%s\n",ip);
9 printf("ip size:%d\n",sizeof(ip));
10 if(*ip == '\0')
11 printf("ip is none\n");
12 printf("g_ip:%s\n",g_ip);
13 printf("g_ip size:%d\n",sizeof(g_ip));
14 if(*ip == '\0')
15 printf("g_ip is none\n");
16 return 0;
17 }
18
19 int main()
20 {
21 const char ip[32]="ABCDEFG";
22 func1(ip);
23 return 0;
24 }


const char g_ip[32] = "123456789";
int func1(const char *ip)
{
printf("ip:%s\n",ip);
printf("ip size:%d\n",sizeof(ip));
if(*ip == '\0')
printf("ip is none\n");
printf("g_ip:%s\n",g_ip);
printf("g_ip size:%d\n",sizeof(g_ip));
if(*ip == '\0')
printf("g_ip is none\n");
return 0;
}

int main()
{
const char ip[32]="ABCDEFG";
func1(ip);
return 0;
}
/*
通过函数传递进去的参数并不会依照定义时候的大小
*/

0 comments on commit 7dea091

Please sign in to comment.