vc15main.cpp

来自「c#设计模式WithCla」· C++ 代码 · 共 26 行

CPP
26
字号
//This sample main program may be used to test Visual C++ code generation scripts.
//In With Class load cppcar.omt.  Run the scripts vc15head.sct and vc15func.sct
//with a QuickWin project. Add to the project vc15main.cpp, vehicle.cpp, 
//car.cpp, motor.cpp, passengr.cpp, tire.cpp, and clllrphn.cpp.
//Comments and suggestions are solicited Richard Felsinger, RCF Associates
//960 Scottland Dr, Mt Pleasant, SC 29464 tele 803-881-3648 71162.755@compuserve.com

#include <iostream.h>
#include "stdafx.h"
#include "car.h"

int main ()
{ 
  Car car1;                     //Creates car1 object without a passenger
  cin >> car1;                  //Invokes insertion operator>>                                  
  cout << car1;                 //Invokes extraction operator<<
  
  Car car2 (55, 10);                //Invokes constructor with arguments
    
  car1 = car2;                  //Invokes assignment operator=
  if (car1 == car2) cout << "Cars are equal.";//Invokes equality operator==
  else cout << "Cars are not equal.";

  return 0;
} 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?