Advertisement
C_Volume2 Miscellaneous #82082

Code Example - explicit keyword

example of the explicit keyword.

AI

AI சுருக்கம்: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

மூலக் குறியீடு
original-source
/* Example of the explicit keyword
  written by Jared Bruni
  www.LostSideDead.com
*/
#include<iostream>

class String
{
private:
	char *str;
public:
	explicit String(int n);
	String();
	~String();
};
String::String()
{
	str = NULL;
}
String::String(int n)
{
	str = new char [ n + 1 ];
}
String::~String()
{
	if(str != NULL)
	{
		delete [] str;
		str = NULL;
	}
}

int main()
{
	String str(100);
	return (0);
}
அசல் கருத்துகள் (3)
வேபேக் மெஷினிலிருந்து (Wayback Machine) மீட்டெடுக்கப்பட்டது