
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
什麼是 C++ 中的區域性變數?
在函式或程式碼塊內宣告的變數是區域性變數。它們只能由該函式或程式碼塊內的語句使用。區域性變數本身對函式是不可知的。
示例
#include <iostream> using namespace std; int main () { int a, b; int c; a = 10; b = 20; c = a + b; cout << c; return 0; }
輸出
將給出如下輸出 −
30
廣告