A<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.cppe.ru/index.php?action=history&amp;feed=atom&amp;title=C%2B%2B_Tutorial%2FLanguage_Basics%2FVariables</id>
		<title>C++ Tutorial/Language Basics/Variables - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.cppe.ru/index.php?action=history&amp;feed=atom&amp;title=C%2B%2B_Tutorial%2FLanguage_Basics%2FVariables"/>
		<link rel="alternate" type="text/html" href="http://www.cppe.ru/index.php?title=C%2B%2B_Tutorial/Language_Basics/Variables&amp;action=history"/>
		<updated>2026-04-17T19:34:31Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.cppe.ru/index.php?title=C%2B%2B_Tutorial/Language_Basics/Variables&amp;diff=2637&amp;oldid=prev</id>
		<title> в 14:21, 25 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.cppe.ru/index.php?title=C%2B%2B_Tutorial/Language_Basics/Variables&amp;diff=2637&amp;oldid=prev"/>
				<updated>2010-05-25T14:21:17Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 14:21, 25 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.cppe.ru/index.php?title=C%2B%2B_Tutorial/Language_Basics/Variables&amp;diff=2638&amp;oldid=prev</id>
		<title>Admin: 1 версия:&amp;#32;Импорт контента...</title>
		<link rel="alternate" type="text/html" href="http://www.cppe.ru/index.php?title=C%2B%2B_Tutorial/Language_Basics/Variables&amp;diff=2638&amp;oldid=prev"/>
				<updated>2010-05-25T10:30:10Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия: Импорт контента...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==A scoping example==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
using std::cout;&lt;br /&gt;
using std::endl;&lt;br /&gt;
void useLocal( void ); &lt;br /&gt;
void useStaticLocal( void ); &lt;br /&gt;
void useGlobal( void ); &lt;br /&gt;
int x = 1;&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
   int x = 5;&lt;br /&gt;
   cout &amp;lt;&amp;lt; x &amp;lt;&amp;lt; endl;&lt;br /&gt;
   {&lt;br /&gt;
      int x = 7;&lt;br /&gt;
      cout &amp;lt;&amp;lt; &amp;quot;local x in main&amp;quot;s inner scope is &amp;quot; &amp;lt;&amp;lt; x &amp;lt;&amp;lt; endl;&lt;br /&gt;
   }&lt;br /&gt;
   cout &amp;lt;&amp;lt; x &amp;lt;&amp;lt; endl;&lt;br /&gt;
   useLocal(); &lt;br /&gt;
   useStaticLocal(); &lt;br /&gt;
   useGlobal(); &lt;br /&gt;
   useLocal(); &lt;br /&gt;
   useStaticLocal(); &lt;br /&gt;
   useGlobal(); &lt;br /&gt;
   cout &amp;lt;&amp;lt; x &amp;lt;&amp;lt; endl;&lt;br /&gt;
   return 0;&lt;br /&gt;
} &lt;br /&gt;
void useLocal( void )&lt;br /&gt;
{&lt;br /&gt;
   int x = 25;&lt;br /&gt;
   cout &amp;lt;&amp;lt; &amp;quot;local x is &amp;quot; &amp;lt;&amp;lt; x &amp;lt;&amp;lt; &amp;quot; on entering useLocal&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
   x = x + 20;&lt;br /&gt;
   cout &amp;lt;&amp;lt; &amp;quot;local x is &amp;quot; &amp;lt;&amp;lt; x &amp;lt;&amp;lt; &amp;quot; on exiting useLocal&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
} &lt;br /&gt;
void useStaticLocal( void )&lt;br /&gt;
{&lt;br /&gt;
   static int x = 50;&lt;br /&gt;
   cout &amp;lt;&amp;lt; &amp;quot;local static x is &amp;quot; &amp;lt;&amp;lt; x &amp;lt;&amp;lt; &amp;quot; on entering useStaticLocal&amp;quot; &lt;br /&gt;
      &amp;lt;&amp;lt; endl;&lt;br /&gt;
   x = x + 20;&lt;br /&gt;
   cout &amp;lt;&amp;lt; &amp;quot;local static x is &amp;quot; &amp;lt;&amp;lt; x &amp;lt;&amp;lt; &amp;quot; on exiting useStaticLocal&amp;quot; &lt;br /&gt;
      &amp;lt;&amp;lt; endl;&lt;br /&gt;
} &lt;br /&gt;
void useGlobal( void )&lt;br /&gt;
{&lt;br /&gt;
   cout &amp;lt;&amp;lt; &amp;quot;global x is &amp;quot; &amp;lt;&amp;lt; x &amp;lt;&amp;lt; &amp;quot; on entering useGlobal&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
   x = x + 20;&lt;br /&gt;
   cout &amp;lt;&amp;lt; &amp;quot;global x is &amp;quot; &amp;lt;&amp;lt; x &amp;lt;&amp;lt; &amp;quot; on exiting useGlobal&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;5&lt;br /&gt;
local x in main&amp;quot;s inner scope is 7&lt;br /&gt;
5&lt;br /&gt;
local x is 25 on entering useLocal&lt;br /&gt;
local x is 45 on exiting useLocal&lt;br /&gt;
local static x is 50 on entering useStaticLocal&lt;br /&gt;
local static x is 70 on exiting useStaticLocal&lt;br /&gt;
global x is 1 on entering useGlobal&lt;br /&gt;
global x is 21 on exiting useGlobal&lt;br /&gt;
local x is 25 on entering useLocal&lt;br /&gt;
local x is 45 on exiting useLocal&lt;br /&gt;
local static x is 70 on entering useStaticLocal&lt;br /&gt;
local static x is 90 on exiting useStaticLocal&lt;br /&gt;
global x is 21 on entering useGlobal&lt;br /&gt;
global x is 41 on exiting useGlobal&lt;br /&gt;
5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Assign value to a variable==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;#include &amp;lt;iostream&amp;gt; &lt;br /&gt;
using namespace std; &lt;br /&gt;
 &lt;br /&gt;
int main() &lt;br /&gt;
{ &lt;br /&gt;
  int length; // this declares a variable &lt;br /&gt;
 &lt;br /&gt;
  length = 7; // this assigns 7 to length &lt;br /&gt;
 &lt;br /&gt;
  cout &amp;lt;&amp;lt; &amp;quot;The length is &amp;quot;; &lt;br /&gt;
  cout &amp;lt;&amp;lt; length; // This displays 7 &lt;br /&gt;
 &lt;br /&gt;
  return 0; &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;The length is 7&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Comparing data values==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
using std::cin;&lt;br /&gt;
using std::cout;&lt;br /&gt;
using std::endl;&lt;br /&gt;
int main() {&lt;br /&gt;
  char first = 10;&lt;br /&gt;
  char second = 20;&lt;br /&gt;
  cout &amp;lt;&amp;lt; &amp;quot;The value of the expression first &amp;lt; second is: &amp;quot;&lt;br /&gt;
       &amp;lt;&amp;lt; (first &amp;lt; second)&lt;br /&gt;
       &amp;lt;&amp;lt; endl&lt;br /&gt;
       &amp;lt;&amp;lt; &amp;quot;The value of the expression first == second is: &amp;quot;&lt;br /&gt;
       &amp;lt;&amp;lt; (first == second)&lt;br /&gt;
       &amp;lt;&amp;lt; endl;&lt;br /&gt;
  return 0;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;The value of the expression first &amp;lt; second is: 1&lt;br /&gt;
The value of the expression first == second is: 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Dynamic initialization.==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;#include &amp;lt;iostream&amp;gt; &lt;br /&gt;
using namespace std; &lt;br /&gt;
  &lt;br /&gt;
int main() { &lt;br /&gt;
  double radius = 4.0, height = 5.0; &lt;br /&gt;
 &lt;br /&gt;
  // dynamically initializ volume &lt;br /&gt;
  double volume = 3.1416 * radius * radius * height; &lt;br /&gt;
 &lt;br /&gt;
  cout &amp;lt;&amp;lt; &amp;quot;Volume is &amp;quot; &amp;lt;&amp;lt; volume; &lt;br /&gt;
 &lt;br /&gt;
  return 0; &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Volume is 251.328&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Finding maximum and minimum values for data types==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;#include &amp;lt;limits&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
using std::cout;&lt;br /&gt;
using std::endl;&lt;br /&gt;
using std::numeric_limits;&lt;br /&gt;
int main() {&lt;br /&gt;
  cout &amp;lt;&amp;lt; &amp;quot;The range for type short is from &amp;quot;&lt;br /&gt;
       &amp;lt;&amp;lt; numeric_limits&amp;lt;short&amp;gt;::min()&lt;br /&gt;
       &amp;lt;&amp;lt; &amp;quot; to &amp;quot;&lt;br /&gt;
       &amp;lt;&amp;lt; numeric_limits&amp;lt;short&amp;gt;::max();&lt;br /&gt;
  cout &amp;lt;&amp;lt; &amp;quot;The range for type int is from &amp;quot;&lt;br /&gt;
       &amp;lt;&amp;lt; numeric_limits&amp;lt;int&amp;gt;::min()&lt;br /&gt;
       &amp;lt;&amp;lt; &amp;quot; to &amp;quot;&lt;br /&gt;
       &amp;lt;&amp;lt; numeric_limits&amp;lt;int&amp;gt;::max();&lt;br /&gt;
  cout &amp;lt;&amp;lt; &amp;quot;The range for type long is from &amp;quot;&lt;br /&gt;
       &amp;lt;&amp;lt; numeric_limits&amp;lt;long&amp;gt;::min()&lt;br /&gt;
       &amp;lt;&amp;lt; &amp;quot; to &amp;quot;&lt;br /&gt;
       &amp;lt;&amp;lt; numeric_limits&amp;lt;long&amp;gt;::max();&lt;br /&gt;
  cout &amp;lt;&amp;lt; &amp;quot;The range for type float is from &amp;quot;&lt;br /&gt;
       &amp;lt;&amp;lt; numeric_limits&amp;lt;float&amp;gt;::min()&lt;br /&gt;
       &amp;lt;&amp;lt; &amp;quot; to &amp;quot;&lt;br /&gt;
       &amp;lt;&amp;lt; numeric_limits&amp;lt;float&amp;gt;::max();&lt;br /&gt;
  cout &amp;lt;&amp;lt; &amp;quot;The range for type double is from &amp;quot;&lt;br /&gt;
       &amp;lt;&amp;lt; numeric_limits&amp;lt;double&amp;gt;::min()&lt;br /&gt;
       &amp;lt;&amp;lt; &amp;quot; to &amp;quot;&lt;br /&gt;
       &amp;lt;&amp;lt; numeric_limits&amp;lt;double&amp;gt;::max();&lt;br /&gt;
  cout &amp;lt;&amp;lt; &amp;quot;The range for type long double is from &amp;quot;&lt;br /&gt;
       &amp;lt;&amp;lt; numeric_limits&amp;lt;long double&amp;gt;::min()&lt;br /&gt;
       &amp;lt;&amp;lt; &amp;quot; to &amp;quot;&lt;br /&gt;
       &amp;lt;&amp;lt; numeric_limits&amp;lt;long double&amp;gt;::max();&lt;br /&gt;
  cout &amp;lt;&amp;lt; endl;&lt;br /&gt;
  return 0;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;The range for type short is from -32768 to 32767The range for type int is from -&lt;br /&gt;
2147483648 to 2147483647The range for type long is from -2147483648 to 214748364&lt;br /&gt;
7The range for type float is from 1.17549e-038 to 3.40282e+038The range for type&lt;br /&gt;
 double is from 2.22507e-308 to 1.79769e+308The range for type long double is fr&lt;br /&gt;
om 0 to 1.#INF&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using the unary scope resolution operator==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
using std::cout;&lt;br /&gt;
using std::endl;&lt;br /&gt;
int n = 7; &lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
   double n = 10.5;&lt;br /&gt;
   cout &amp;lt;&amp;lt; &amp;quot;Local double value of n = &amp;quot; &amp;lt;&amp;lt; n&lt;br /&gt;
      &amp;lt;&amp;lt; &amp;quot;\nGlobal int value of n = &amp;quot; &amp;lt;&amp;lt; ::n &amp;lt;&amp;lt; endl;&lt;br /&gt;
   return 0;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Local double value of n = 10.5&lt;br /&gt;
Global int value of n = 7&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>