top of page

Initializing Local and Global Variables

  • Writer: -A
    -A
  • Jan 28, 2020
  • 1 min read

When a local variable is defined, it is not initialized by the system, you must initialize it yourself. Global variables are initialized automatically by the system when you define them as follows −


ree

It is a good programming practice to initialize variables properly, otherwise sometimes program would produce unexpected result.

Recent Posts

See All
Variable Scope in C++

A scope is a region of the program and broadly speaking there are three places, where variables can be declared − Inside a function or a...

 
 
 

Comments


Post: Blog2_Post

Subscribe Form

Thanks for submitting!

  • Instagram
  • Facebook

©2020 by C++ Programming. Proudly created with Wix.com

bottom of page