- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHPPhysics
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
广告