Stardard coding convention

Today, I fix one ccr of wording change. One solution I chose is to use macro to replace the string.

Like this one,

#define REPLCE_STRING   _T("coding")

CString str;

str.Format(""REPLCE_STRING" and perfect");

The replace above will make reader confused when they want to change something related. But I found this is effective when changing string.

The standard coding convention should be used like below.

str.Format("%s", REPLCE_STRING);

 

posted @ 2016-08-15 21:40  飞在风口的猪  阅读(203)  评论(0编辑  收藏  举报