yang131

导航

c++ 中遇到的语法问题

在头文件中给函数赋值 如这样:

func(int a,int b = 1); 在.cpp文件中不能同时这样写,否则会报错,只能这样写func(int a,int b ),所以从其他地方移植的代码需要注意

posted on 2022-01-23 18:28  NoNight  阅读(50)  评论(0编辑  收藏  举报