- 6月 29 週三 201616:07
Notepad++支持顯示回车符,换行符,TAB键,行首,行尾等特殊字符
- 6月 28 週二 201623:05
C語言:顯示中文字錯誤
今天在寫小程式的時候遇到編碼問題,我輸出一段中文字
1 | cout<<"午餐"; |
- 6月 24 週三 201500:16
C 語言學習紀錄
int a => auto variable
The cost of setting auto variables to 0 would
increase the cost of function calls. C has a very
strong focus on execution speed.
- 1月 07 週三 201520:22
break 和 continue 學習
1. break 對於巢狀迴圈或多重迴圈,只會跳離一層!#include<stdio.h>
#include<conio.h>
int main()
{
int i = 5, j = 0;
int a = 0;
for( i=0; i<5; i++ )
{
for( j=0; j<4; j++ )
{
if(i==3)
break;
a += i+j;
}
}
- 1月 07 週三 201517:01
丟骰子 : 使用亂數
Write a program to simulate a dice, and print out the minimum times to throw out all the numbers.
- 12月 24 週三 201415:05
基本運算子 a++ 與 ++a 差異
a=b++ + ++b*c%3 :
a=b;
- 12月 23 週二 201422:14
設計模式 Design Pattern
程式設計是思維具體化的一種方式,是思考如何解決問題的過程,設計模式是在解 決問題的過程中,一些良好思路的經驗集成,最早講設計模式,人們總會提到 Gof 的著作,它最早將經典的 23 種模式集合在一起說明,對後期學習程式設計,尤其是對從事物件導向程式設計的人們起了莫大的影響。後來設計模式一詞被廣泛的應用到各種經驗集成,甚至還有反模式 (AntiPattern),反模式教導您如何避開一些常犯且似是而非的程式設計思維。
這邊的話將整理一些設計模式學習心得,實作的部份是使用 Java 與 Python,在這邊所看到的 UML 圖都是使用 Jude 繪製的。
這邊的話將整理一些設計模式學習心得,實作的部份是使用 Java 與 Python,在這邊所看到的 UML 圖都是使用 Jude 繪製的。
- 12月 23 週二 201421:09
學習C++:字串和指標大小
#include<iostream>
#include<stdio.h>
#include<conio.h>
using namespace std;
int main()
{
char str[] = "Hello";
char* p=str;
int n=270;
int m;
printf("%x\n",p);
//%d:2358624(10進位) = %x:23fd60(16進位)
printf("%d %d %d %d\n",sizeof(str), sizeof(p), sizeof(n), sizeof(m));
//Ans:6 8 4 4
#include<stdio.h>
#include<conio.h>
using namespace std;
int main()
{
char str[] = "Hello";
char* p=str;
int n=270;
int m;
printf("%x\n",p);
//%d:2358624(10進位) = %x:23fd60(16進位)
printf("%d %d %d %d\n",sizeof(str), sizeof(p), sizeof(n), sizeof(m));
//Ans:6 8 4 4
1
