guaguaupup / cpp_interview Goto Github PK
View Code? Open in Web Editor NEWc++后台服务器开发面经或八股总结!(有深度有广度,和仅有概念的总结文章不同!)
c++后台服务器开发面经或八股总结!(有深度有广度,和仅有概念的总结文章不同!)
String::String(const String &&other) // 得分点:输入参数为const型
{
m_data = other.data;
other.data = nullptr;
}
大佬大佬,这里other是不是有误,应该不能是const类型吧
Line 1583 in 201c99a
String::String(const String&& other)
{
m_data = other.m_data;
other.m_data = nullptr;
}
传入const的对象怎么修改other.m_data呢?
应该改成
String::String(String &&other)
{
m_data = other.m_data;
other.m_data = nullptr;
}
C++智能指针章节八股文,make_shared方法里面差两张图片无法加载哟
accept应该是发生在三次握手之后?
connect发生在三次握手之前?
你好,今天在搜索c++八股的repo看到这个,很详尽!不过我看repo里常考代码部分没办法查看了
建议添加text、bss、data、stack、heap或者是代码段、全局静态段、常量段、堆、栈之类的描述
在第四点中
是否可以做函数参数
宏定义不能作为参数传递给函数
const常量可以在函数的参数列表中出现
我觉得宏定义是可以作为参数传递给函数,宏只是一个简单的替换,也是可以放在函数参数中,无论是实际参数传递还是作为形参部分都是可以的
void LRUCache::show(){
//链表中没有节点,退出
if(head_node->next = head_node){
return;
}
Node* tmp = head_node->next;
while(tmp->next != head_node){
std::cout<<"key:"<key<<",vlaue:"<value<<std::endl;
}
}
这里的while循环是不是有点问题啊,条件应该是tmp!=head_node,里面应该加一句tmp=tmp->next?
大佬,线程池销毁线程这里
void Thread_pool::destory_thread(){
pthread_t tid = pthread_self();
for(int i = 0; i < m_max_num; i++){
if(thread_compose[i] == tid){
std::cout << "threadExit() function: thread "
<< std::to_string(pthread_self()) << " exiting..." << std::endl;
}
thread_compose[i] = 0;
break;
}
pthread_exit(nullptr);
}
的thread_compose[i] = 0;
break;
是不是应该放在if判断里面呀
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.