Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
像这样的代码:
int totalLen = 50; int usTest = htons(totalLen); char* strBuf = new char[totalLen ]; memcpy(strBuf,&usTest,sizeof(int));
在此之后,strBuf 中没有任何内容,为什么?
但是如果我输入一个大数字,比如100000001,就可以了吗?
100000001
有什么问题?