Skip to content

QueenieCplusplus/Type_Inspection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Type_Inspection

C++ 實作,很多方程式利用型別檢驗,檢視型別安全。

提供 code 額外進階的寫法如下:

#include <iostream>

bool goOn() {

    std:: cout << "Do You wanna go on? (y or n)\n"; // question isuued

    char answer = 0;
    std::cin >> answer;

    switch(answer) {
    
      case 'y':
          return true;
      
      case 'n':
          return false;
      
      default:
          cout << "I guess you are trying to say no.\n";
          return false;
    
    }

}

int main() {

    goOn();
    return 0;

}

About

型別檢驗,檢視型別安全。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages