看淡生死,不服就幹ios
emmmmm數組
其實今天蠻煩的 函數
高等數學考的一塌糊塗 spa
會的不會的都沒寫 指針
真心沒有高中輕鬆了啊 code
也不知道本身立的flag還能不能實現 blog
既然選擇了就必定堅持下去啊字符串
下面仍是放一段以前寫的代碼吧數學
這個代碼是C和C++的混合版本string
關於兼容性的問題裏面有標註
main 函數應該是被我吃了
emmmmmm 好煩
#include<iostream> #include<stdlib.h> #include<stdio.h> #include<math.h> #include<ctime> #include<cmath> #include<cstdlib> #include<cstdio> #include<iostream> #include<string.h> #include<cstring> #include<Windows.h> #include<string.h> using namespace std; void zz_first() //數字應用指針 { int * a, b=85; a = &b; cout << *a; } void zz_second()//一維數組的應用指針 { int* c, d[10] = { 1,2,3,4,5,6,7,8,9,0 },e; c = d; //c = &d[0]; 不一樣的寫法 for (e = 0; e < 10; e++) { cout << *(c + e)<<endl; Sleep(100); } } void zz_third()//二維數組的指針 { int* f, g[2][3] = { 1,2,3,4,5,6 },h,i; f = g[0]; //f = &g[0][0]; for (h = 0; h < 6; h++) { cout << *f++; } } //void zz_thirdt() //二維數組的指針 //{ // int i[2][3] = { 2,3,4,5,6,1 }; // int(*j)[3]; // int k, l; // for (k = 0; k < 2; k++) // { // for (l = 0; l < 3; l++) // { // printf("%d", (*(j + k) + l)); // } // } //} C++不兼容,去C實驗 void zz_fourth()//字符串複習 { char a[10] = { "hello" }; printf("%s", a); } int main() { zz_third(); return 0; }