摘要:
#include <stdio.h> #include <stdlib.h>
#define pi 3.1415 //定义全局变量 存放在code区 // 作业: 从键盘接受一个数组 数组的大小 随着输入数据的变化 而变化 void printArr(int* arr, int len){ // arr是数组的首地址 len数组的长度 int i=0; for(;i<len;i++){ // 在c99 的语法格式下 for循环的初始化条件 不能写在 for 循环的括号里面 // printf("arr[... 阅读全文
摘要:
#include <stdio.h> #include <stdlib.h> main() { int i =3; double d = 3.141692; float f = 3.1423; char c ='B'; int* ip = &i; double* dp = &d; float* fp = &f; char* cp = &c; printf("int 类型指针变量的... 阅读全文
摘要:
#include <stdio.h> #include <stdlib.h>
// 数组是一块连续的内存空间 数组名 就是内存空间的首地址 // 数组名[i] == *(数组名+i); main() { /* char[] arr = new char[20]; char arr[] ; */ // 创建一个长度为5的int类型的数组 int arr[5] ={1,2,3,4,5}; p... 阅读全文
摘要:
#include <stdio.h> #include <stdlib.h> main() { char arr[20] ={'h','e','l','l','o','\0'};//char数组表示字符串很麻烦 // 利用char类型指针 方便的表示一个字符串 char* arr1= "hello world"; printf("%s",arr1); //%s是字符串的占位符 arr1是一个地址 system("pause&q 阅读全文
摘要:
今天居然遇到Ubuntu死机了,Ctrl+Alt+Fn没用。一度想到直接按那个重启键。还是冷静的上网找了找,找到一篇我用了可以的先贴在这,原文地址1. X死掉,(1)Ctrl-Alt-Backspace(ubuntu 9.04默认关闭了这项功能,需手动添加)(2)Ctrl-Alt-(F1~F6)2. ubuntu 9.04不太稳定,经常完全死掉,上述办法往往没用,可采用下面办法: 同时按下左 Alt 键、SysRq 键(与 PrintScreen在一个键上)和一个字母键 这些键要起作用,好像要在编译内核时启用该功能,ubuntu 9.04 的内核有这功能。(1)Alt-SysRq-R,然后Ct 阅读全文
摘要:
1.终端输入:sudo gedit ~/.bashrc2.将下面的两句加到上面打开的文件里 ,假设你安装路径为/opt/android-sdk-linux_x86export ANDROID_HOME=/opt/android-sdk-linux_x86export PATH=$PATH:$ANDROID_HOME/platform-toolsandroid3.0以后adb都是在platform-tools3.重启电脑 阅读全文