Repository navigation
at函数原型 #7
Answered
by
caikelun
Mr-JingShi
asked this question in
Q&A
at函数原型
#7
|
请问下:std::string里at的函数原型是reference at( size_type pos ); 请老师解答下。 |
Answered by
caikelun
Mar 10, 2022
Replies: 2 comments
c++里的reference底层实现是相对应类型的指针的原因吗? |
0 replies
|
在运行时,根据C++成员函数的调用约定,需要把this作为第一个参数传递。如果是C++代码,C++编译器会为我们完成这些(可以看下C++函数调用生成的汇编代码)。但是在C代码中我们需要手工传递this参数。 |
0 replies
Answer selected by
caikelun
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
在运行时,根据C++成员函数的调用约定,需要把this作为第一个参数传递。如果是C++代码,C++编译器会为我们完成这些(可以看下C++函数调用生成的汇编代码)。但是在C代码中我们需要手工传递this参数。