| Cú pháp | Ví dụ |
| const kiểu_dữ_liệu tên_hằng = giá_trị | const int a = 10; const char x = ‘\t’; |
Compile and Execute Java Online - Try and experience the best cloud computing where you can edit, compile, ... Compile Preview | Execute | Share Code.
Saturday, September 11, 2010
Khai báo hằng const
Bạn có thể khai báo một hằng bằng cách sử dụng từ khóa const. Cấu trúc khai báo như sau:
Các bạn có thể thấy cách khai báo tương tự như khai báo biến, chỉ khác một điểm là bạn bổ sung từ khóa const vào trước. Hằng và biến cũng tương tự nhau. Chúng chỉ khác nhau một điểm duy nhất là giá trị của hằng không thể thay đổi, còn biến thì có thể.
Labels:
C++
Subscribe to:
Post Comments (Atom)
Popular Posts
-
Announcing hspec - BDD for Haskell I've long been interested in Behavior Driven Design and it's something that is strangely missing ...
-
This tutorial will be written in Java since I'm familiar with it and it's a decent enough language, has many tools and libraries, a ...
-
Bước 1 . Sử dụng ảnh rocket.psd để import vào trong dự án Flash của bạn. Xây dựng 2 layer để chứa tên lửa và phần nhiên liệu bị đốt cháy. Bư...
-
I'd like to make a post about something that I think is one of the least utilized aspects of C#: custom collection initializers. Impleme...
-
[FD's BlOg] - Adnet là một hệ thống quảng cáo trực tuyến trên nền tảng mạng Internet mà công cụ chính là các Website & Blog. Adnet ...
-
Về cơ bản, screensaver là một tập tin có khả năng tự thực thi (executable). Do đó, nó có thể phát triển bằng hầu hết các ngôn ngữ lập trình....
-
Pro form comment for blogger [FD's BlOg] - Chúng ta có lẽ khá quen với form comment của blogger , với tính năng hiển thị thời gian comm...
-
Want to know the shortest path from one point to another? If you're making a roguelike then you probably do. You could use Dijkstra'...
-
More vague notes about rogulikes; this time about monster difficulty or Power Curve . In I Rule, You Rule, We All Rule Old-School Hyrule th...
-
That's something I learnt. When use grab code from server, if you use 'git pull' , it makes behind the scene two command 'g...
No comments:
Post a Comment