<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>static member function | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/static-member-function/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sat, 13 Mar 2010 17:09:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>C++ program to illustrate the static member function</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-illustrate-the-static-member-function/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-illustrate-the-static-member-function/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Sat, 13 Mar 2010 17:09:40 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[static member function]]></category>
		<category><![CDATA[static functions]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1064</guid>

					<description><![CDATA[<p>AIM Write a program to illustrate the static member function. ALGORITHM 1. Start the process 2. Invoke the class i. Set the data member and member function as a static b. Create two objects t1 and t2 3. Call the function t1.setcode i. Increment the value of data member count 4. Call the function t1.setcode</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-illustrate-the-static-member-function/">C++ program to illustrate the static member function</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><strong>AIM</strong><br />
Write a program to illustrate the static member function.</p>
<p><strong>ALGORITHM</strong></p>
<p>1.	Start the process<br />
2.	Invoke the class<br />
i.	Set the data member and member function as a static<br />
b.	Create two objects t1 and t2<br />
3.	Call the function t1.setcode<br />
i.	Increment the value of data member count<br />
4.	Call the function t1.setcode<br />
i.	Increment the value of data member count<br />
5.	Call the static member function showcount()<br />
i.	Display the value of count<br />
6.	Create a new object t3<br />
7.	Call the function t3.set code()<br />
8.	Call t1.showcount(), t2.showcount() and t3.showcount()<br />
9.	Stop the process</p>
<p><strong>PROGRAM</strong></p>
<pre lang="cpp">
#include<iostream.h>
#include<conio.h>

class test
{
	int code;
	static int count;
	public :
		void setcode(void)
		{
			code= ++count;
		}
		void showcode(void)
		{
			cout<<"object number"<<code<<endl;
		}
		static void showcount(void)
		{
			cout<<"count"<<count<<endl;
		}
};
int test::count;

int main()
{
	clrscr();
	test t1,t2;
	t1.setcode();
	t2.setcode();
	test::showcount();
	test t3;
	t3.setcode();
test::showcount();
	t1.showcode();
	t2.showcode();
	t3.showcode();
	getch();
	return(1);	    
}
</pre>
<p><strong>OUTPUT</strong></p>
<p>	Count 2<br />
	Count 3<br />
	Object number 1<br />
	Object number 2<br />
	Object number 3</p><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-illustrate-the-static-member-function/">C++ program to illustrate the static member function</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-illustrate-the-static-member-function/feed/</wfw:commentRss>
			<slash:comments>16</slash:comments>
		
		
			</item>
	</channel>
</rss>
