Skip to content

Instantly share code, notes, and snippets.

View johnhmj's full-sized avatar
😃
online

John "DumbSheep" Hsieh johnhmj

😃
online
View GitHub Profile
@johnhmj
johnhmj / gist:704773
Created November 18, 2010 08:25
PTT C/C++ 2010.11.18
#include<iostream>
#include<cstdlib>
#include<vector>
using namespace std;
typedef vector<int> Vint;
int main(int argc, char* argv[])
{
//int i,sum=0,n;
//vector<int> avector;
//printf("請問要計算多少數字的總和");
// Integrated Development Environment
// Visual C++
#include <iostream>
#include <cstdlib>
#include "header.h"
using namespace std;
//
int main(int argc, char** argv)
{
unsigned int length = 0;
// Integrated Development Environment
// Visual C++
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
// 總數量
#define CARSIZE 5
// 一輛車
typedef struct SMyCar
{
1. 設計一主程式,並呼叫一個副程式StrLen()可以算出字串a[]之字元數目。(不包括 \0)
主程式:(1) 輸入一個字串資料a[]。(2) 呼叫StrLen(),印出字串a[]之字元數目。
副程式:StrLen(),可以算出字串a[]之字元數目,並將結果傳回主程式。
1. 設計一主程式,並呼叫一個副程式StrLen()可以算出字串a[]之字元數目。(不包括 \0)
主程式:(1) 輸入一個字串資料a[]。(2) 呼叫StrLen(),印出字串a[]之字元數目。
副程式:StrLen(),可以算出字串a[]之字元數目,並將結果傳回主程式。
2. 設計一主程式,並呼叫一個副程式StrCat()可以將字串a[]與b[]連接成c[]。
主程式:(1) 輸入兩個字串資料a[]與b[]。(2) 呼叫StrCat (),印出a[]、b[]、c[]之內容。
副程式:StrCat (),將字串a[]與b[]連接成c[],並將結果傳回主程式。
3. 設計一主程式,並呼叫一個副程式StrCopy()可以將字串a[]複製成b[]。
主程式:(1) 輸入一個字串資料a[]。(2) 呼叫StrCopy ()將字串a[]複製成b[],再印出a[]、b[]之內容。
副程式:StrCopy (),將字串a[]複製成b[],並將結果傳回主程式。
4. 設計一主程式,並呼叫一個副程式StrLeftN()可以截取字串的左側N個字元。
2. 設計一主程式,並呼叫一個副程式StrCat()可以將字串a[]與b[]連接成c[]。
主程式:(1) 輸入兩個字串資料a[]與b[]。(2) 呼叫StrCat (),印出a[]、b[]、c[]之內容。
副程式:StrCat (),將字串a[]與b[]連接成c[],並將結果傳回主程式。
#include <stdio.h>
#include <stdlib.h>
#define BUFFERSIZE 1024
//
int main(int argc, char* argv[])
{
char* ptr = NULL;
char* pReader = NULL;
int i = 0, counter = 0;
// 動態配置記憶體
real
real
real
real
fake
fake
real
real
real
real
// @eyny@Force[TW]@
#include "forcetw20101222.h"
//
CWChar::CWChar(void)
{
this->m_wcs = NULL;
this->m_size = 0;
}
CWChar::CWChar(const char* str)
{
// @eyny@Force[TW]@
#include "forcetw20101224.h"
//
CBitset::CBitset(void)
{
this->m_dec = 0;
this->m_bitlen = 0;
this->m_bitset.clear();
}
CBitset::CBitset(unsigned int nBitLen, unsigned int nVal)