程序调试技术:
(1)阅读程序,静态代码复查;
(2)“cout大法”
(3)使用开发工具,断点
int main() { TShape s(lu, lu); cout << __FILE__ << ": " << __LINE__ << " "; s.Draw(); TEllipse elps(10u,5u, 20u, 30u); cout << __FILE__ << ": " << __LINE__ << " "; elps.TShape::Draw(); return 0; }
说明:
cout << __FILE__ << ": " << __LINE__ << " ";
输出当前源代码所在的文件名及当前语句所在的行号;
原文地址:https://www.cnblogs.com/eilearn/p/10954379.html
时间: 2024-11-08 22:56:54