是否总是需要从派生类构造函数调用基类构造函数?当你不打电话时会发生什么?
void main()
{
char s[100]="hello";
char *t;
t=(char*)malloc(100);
strcpy(t,s);
}
Run Code Online (Sandbox Code Playgroud)
另外,我们可以分配s给t这样的:t=s;.使用替代方案有什么缺点?
假设有一个名为"swaplt.doc"的文件,其中包含超过200字节的数据.现在编写一个程序,通过将前100个字节的数据与最后100个字节进行交换来加密文件.