Lesson 1: A Simple Welcome Program

This lesson will get you started with C# by introducing a few very simple programs. | Tutorial Page 1 of 5 Using Excellent Tools to Write Web Applications Tar the .NET Common Language Runtime CLR Home Up Lesson01 Lesson02 Lesson03 Lesson04 Les Lesson06 Lesson07 Lesson08 Lesson09 Lesson10 Les Lesson12 Lesson13 On sale Now C Unleashed is an indepth guide for intermediate to advanced software developers to learn the C programming language and serve as a desktop reference. The C Station Tutorial by Joe Mayo 8 20 00 updated 9 24 01 Lesson 1 A Simple Welcome Program This lesson will get you started with C by introducing a few very simple programs. Here are the objectives of this lesson Understand the basic structure of a C program. Obtain a basic familiarization of what a Namespace is. Obtain a basic understanding of what a Class is. Learn what a Main method does. Learn how to obtain command-line input. Learn about console input output I O . Listing 1-1. A Simple Welcome Program Namespace Declaration using System Program start class class WelcomeCSS Main begins program execution. public static void Main Write to console Welcome to the C Station Tutorial The program in Listing 1 -1 has 4 primary elements a namespace declaration a class a Main method and a program statement. It can b compiled with the following command line csc This produces a file named which can then be executed. http Tutorials 6 24 2002 Tutorial Page 2 of 5 Other programs can be compiled similarly by substituting their file name instead of . For more help about command line options type csc -help . The file name and the class name can be totally different. The namespace declaration indicates that you are referencing the Syster namespace. Namespaces contain groups of code that can be called upon by C programs. With the using System declaration you are telling you program that it can reference the code in the System namespace withoi pre-pending the word System to every reference. I ll discuss

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
35    81    1    15-06-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.