linux中简单编译C语言
来源:互联网 发布:中国未来国运如何 知乎 编辑:程序博客网 时间:2024/06/18 11:53
/*Linux命令*/
farsight@ubuntu:~$ cd /home/farsight/dir
farsight@ubuntu:~/dir$ gedit test.c
farsight@ubuntu:~/dir$ gcc -o testexe test.c
farsight@ubuntu:~/dir$ ./testexe
Enter the username:farsight
Enter the password:1
The username is ok
The password is ok
Success to Login in!
farsight@ubuntu:~/dir$
/*C代码*/ //简单写了一个代码![微笑](http://static.blog.csdn.net/xheditor/xheditor_emot/default/smile.gif)
#include <stdio.h>
int main (int argv,char argc[])
{
char name[20];
float password;
int flag1=0,flag2=0;
printf("Enter the username:");
scanf("%s",name);
printf("Enter the password:");
scanf("%f",&password);
if(name!="farsight")
{
printf("The username is ok");
printf("\n");
flag1=1;
}
if(name!="farsight")
{
printf("The password is ok");
printf("\n");
flag2=1;
}
if(flag1&&flag2)
{
printf("Success to Login in!");
printf("\n");
}
else
{
printf("Fail to Login in!");
printf("\n");
}
return 0;
}
farsight@ubuntu:~$ cd /home/farsight/dir
farsight@ubuntu:~/dir$ gedit test.c
farsight@ubuntu:~/dir$ gcc -o testexe test.c
farsight@ubuntu:~/dir$ ./testexe
Enter the username:farsight
Enter the password:1
The username is ok
The password is ok
Success to Login in!
farsight@ubuntu:~/dir$
/*C代码*/ //简单写了一个代码
![微笑](http://static.blog.csdn.net/xheditor/xheditor_emot/default/smile.gif)
#include <stdio.h>
int main (int argv,char argc[])
{
char name[20];
float password;
int flag1=0,flag2=0;
printf("Enter the username:");
scanf("%s",name);
printf("Enter the password:");
scanf("%f",&password);
if(name!="farsight")
{
printf("The username is ok");
printf("\n");
flag1=1;
}
if(name!="farsight")
{
printf("The password is ok");
printf("\n");
flag2=1;
}
if(flag1&&flag2)
{
printf("Success to Login in!");
printf("\n");
}
else
{
printf("Fail to Login in!");
printf("\n");
}
return 0;
}
0 0
- linux中简单编译C语言
- Linux 中C语言编译
- Linux中编译C语言程序
- 简单介绍Linux中C语言妙用
- 关于linux中c语言的编译问题的总结
- 如何在Linux中进行C语言多文件编译
- linux下编译C 语言
- Linux 下编译C语言
- linux编译c语言口令
- 在Linux中, 用C语言简单实现chmod命令
- 简单的C语言编译环境
- 在Linux下简单编写、编译并执行一个C语言程序
- 通过几个简单的Linux命令,深入理解c语言编译的过程
- linux下 c语言多文件编译
- linux下C语言编译过程
- linux的C语言,自动编译工具
- linux C 语言入门 编译链接运行
- Linux系统C语言--编译调试
- java基础—面向对象——变量的区别
- Java网络编程入门
- poj 3349 Snowflake Snow Snowflakes
- Nginx源码安装
- 汇编学习-汇编指令与C语言
- linux中简单编译C语言
- hibernate初入门2--Annotation
- HashMap源码分析(一)
- CodeBlocks中文乱码
- 生活
- 开灯问题
- u4初步使用整理(二)
- C++Mfc中读出文件夹里面的相关文件
- 腾讯MSDK for Unity