赞
踩
一面:
二面:
1
2
3
4
5
6
struct{
struct
{
char a;
char
a;
short b;
short
b;
int c;
int
c;
char d;
d;
};
int *sp = new int{10};
*sp =
new
{10};
shared_ptr<int> sp1(sp);
shared_ptr<
> sp1(sp);
shared_ptr<int> sp2(sp);
> sp2(sp);
7
8
9
10
#include <sys/types.h>
#include <unistd.h>
pid_t pid1;
pid_t pid2;
pid1 = fork();
pid2 = fork();
cout << "cur pid:"<<getpid() << ",pid1:" << pid1 << ",pid2:" << pid2 << endl;
cout <<
"cur pid:"
<<getpid() <<
",pid1:"
<< pid1 <<
",pid2:"
<< pid2 << endl;
三面: