Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17560

C++ question

$
0
0

This is a very basic question. In int main() why is it a int and not a void and why do you have to return 0.

#include <iostream> // The # represens a preprocessor directive and <iostream is a header file>

int main() 
{  
    //std stands for standard
    std::cout << "You are a secret agent breaking into a secure server room...";
    std::cout << std::endl; //endl means end line
    std::cout << "You need to enter the correct codes to continue...";

    const int a = 4;
    const int b = 3;
    const int c = 2;


    const int sum = a + b + c;
    const int …

Viewing all articles
Browse latest Browse all 17560

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>