Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changes between Version 2 and Version 3 of LearningD-YourFirstProgram

Show
Ignore:
Author:
bmeck (IP: 70.112.111.165)
Timestamp:
05/24/07 17:27:25 (17 years ago)
Comment:

Added example output. Stripped out Line by Line to a new page and added link to Data Structures

Legend:

Unmodified
Added
Removed
Modified
  • LearningD-YourFirstProgram

    v2 v3  
    5050}}} 
    5151 
    52 This is what your program truly is. The important thing to note is that '''int main(char[][])''' is what the compiler sees as the start of a program. All of the other code you see is inside of the function '''main''' but we can learn more about this after we know what kind of operations and data D has to offer. For now, see how the program compiles being sure that you can execute the results. 
     52This is what your program truly is. The important thing to note is that '''int main(char[][])''' is what the compiler sees as the start of a program. All of the other code you see is inside of the function '''main''' but we can learn more about this after we know what kind of operations and data D has to offer. For now, see how the program compiles being sure that you can execute the results. Your output should look something like this if you are using the console: 
     53 
     54{{{ 
     55C:\D\dmd\bin\..\..\dm\bin\link.exe firstprogram,,,c:\d\dmd\lib\ws2_32.lib+user32+kernel32/noi; 
     56What is your name? Bradley 
     57Hello Bradley! Say hello to your first program. Well, thats all I say. Goodbye Bradley 
     58}}} 
     59 
     60If this does not look anything like this and you get a compile error, make sure the the code is the exact same as the code above and you are using the latest D compiler. 
    5361 
    5462If you really want to go into what is going on go to the [wiki:LearningD-YourFirstProgram-StepByStepExplanation line by line explanation].