【size_t】 Vs. 【size_type】

  • size_type是容器概念,没有容器不能使用,size_type类型无法转换
  • typedef unsigned int size_t;

size_t实际上就是unsigned int(用于没有负数情况的变量),如用于数组的下标值类型,也可以用来“接收”sizeof操作符的返回值。

__stdcall and __cdecl

__stdcall
http://msdn.microsoft.com/en-us/library/zxk0tw93.aspx

__cdecl
http://msdn.microsoft.com/en-us/library/zkwh89ks.aspx

Stack-maintenance responsibility
__stdcall: Called function pops its own arguments from the stack.
__cdecl: Calling function pops the arguments from the stack
关于函数调用约定__cdecl 还是 __stdcall。我们可以在输出函数名前添加,也可以用cl编译的时候指明
/Gd 使用 __cdecl 调用约定 (C declaration,是C和C++默认格式),手动堆栈平衡(支持可变参数)
/Gz 使用 __stdcall 调用约定 (是pascal, fortran等的调用约定), 自动堆栈平衡
MSDN specfy:
The __stdcall calling convention is used to call Win32 API functions. The callee cleans the stack, so the compiler makes vararg functions __cdecl. Functions that use this calling convention require a function prototype.

The /Gz compiler option specifies __stdcall for all functions not explicitly declared with a different calling convention.

Functions declared using the __stdcall modifier return values the same way as functions declared using __cdecl.

On Itanium Processor Family (IPF) and x64 processors, __stdcall is accepted and ignored by the compiler

 

source:http://www.cppblog.com/kenny/archive/2011/04/19/144539.html

_tmain VS. main (1)

// test.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
 wcout<< argc<<endl;
 wcout<< argv[0]<< endl;
 system("pause");
 return 0;
}
 
the same as to:
// test.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
 cout<< argc<<endl;
 cout<< argv[0]<< endl;
 system("pause");
 return 0;
}
 
BUT:
// test.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
 cout<< argc<<endl;
 cout<< argv[0]<< endl;
 system("pause");
 return 0;
}
 
MS使用_t前缀的函数目的就在于期望使用一种统一写法可以方便地在宽字符版本和窄字符版本函数间快速地替换。
对于ANSI版本,"_tWinMain"就是"WinMain";对于UINCODE版本,"_tWinMain"就是"wWinMain"。  
  (比如这样的定义:)  
  #ifdef   _UNICODE  
  #define   _tmain   wmain  
  #define   _tWinMain   wWinMain  
  #else  
  #define   _tmain   main  
  #define   _tWinMain   WinMain  
  #endif  
VS 2008 default: Unicode
 
Q:Why UNICODE?
A:"Universal Multiple-Octet Coded Character Set"
在unicode语言环境下,不会再有语言的编码冲突,同屏可以显示任何语言,这就是Unicode的最大好处。
 
Message Box实现多语言即时翻译?
生活在西班牙

自己动手丰衣足食

BlueAsteroid

Just another WordPress.com site

Jing's Blog

Just another WordPress.com site

Start from here......

我的心情魔方

天才遠私廚

希望能做一個分享各種資訊的好地方

语义噪声

西瓜大丸子汤的博客

笑对人生,傲立寰宇

Just another WordPress.com site

Where On Earth Is Waldo?

A Project By Melanie Coles

the Serious Computer Vision Blog

A blog about computer vision and serious stuff

Cauthy's Blog

paper review...

Cornell Computer Vision Seminar Blog

Blog for CS 7670 - Special Topics in Computer Vision

datarazzi

Life through nerd-colored glasses

Luciana Haill

Brainwaves Augmenting Consciousness

槑烎

1,2,∞

Dr Paul Tennent

and the university of nottingham

turn off the lights, please

A bunch of random, thinned and stateless thoughts around the Web