All pastes #773236 Raw Edit

Untitled

public cpp v1 · immutable
·published 2007-11-14 11:07 UTC
rendered paste body
#include <iostream>using namespace std;class user {	  public:	  		 int access_level;	  		 int isoper_bin;};void nl(); // See end of sourceint main(){ 	user Kefka; // Person's nick 		 Kefka.access_level = 9999; // ChanServ access level 		 Kefka.isoper_bin = 1; // Are they an oper? 0 = No; 1 = Yes (BINary) 		  	user BullDog; 		 BullDog.access_level = 9999; 		 BullDog.isoper_bin = 1; 		  	user PsychDragoonX; 		 PsychDragoonX.access_level = 100; 		 PsychDragoonX.isoper_bin = 0; 		  	user Melissa; 		 Melissa.access_level = 50; 		 Melissa.isoper_bin = 1; 	 	/* 	   I really like this whole big chunk of code I made. :P 	   It basically does nothing but assure me I can work with classes. 	   Though, it's very advanced for this point in "training". 	   I'm going to come back to this again later and functionize ("modulize"?) 	   this entire block below, even though it looks pretty snazzy.    */        // Input prompt		  prompt:	  cout << "Show comments at the end of the program? (Press 1 for yes, or 2 for no): "; 	  short unsigned int comments_;      cin >> comments_;	  	// End input prompt		while ((comments_<1)||(comments_>2)) {		cout << "Sorry, that's not valid input." << endl; 		goto prompt; 	}        	cout << endl << "Here is the access list for #KefkasTower." << endl << endl; 	 	// The "if (username.isoper_bin != 0) checks to see if the user is an oper (binary 1 euqalling TRUE)  		cout<<"  Kefka's access level: " << Kefka.access_level; 				   if (Kefka.isoper_bin != 0) { cout << " ISOPER" << endl; } else { nl(); } 				   nl();    cout<<"  BullDog's access level: " << BullDog.access_level;   				   if (BullDog.isoper_bin != 0) { cout << " ISOPER" << endl; } else { nl(); }   				   nl();    cout<<"  PsychDragoonX's access level: " << PsychDragoonX.access_level;   				   if (PsychDragoonX.isoper_bin != 0) { cout << " ISOPER" << endl; } else { nl(); }   				   nl();    cout<<"  Melissa's access level: " << Melissa.access_level;   				   if (Melissa.isoper_bin != 0) { cout << " ISOPER" << endl; } else { nl(); }   				   nl();   		  if (comments_==1) {   cout << "COMMENTS:\n" "I really like this whole big chunk of code I made. :P\n" "It basically does nothing but assure me I can work with classes.\n" "Though, it's very advanced for this point in \"training\".\n" "I'm going to come back to this again later and functionize (\"modulize\"?)\n" "this entire block below, even though it looks pretty snazzy.\n" << endl << endl;}    	return 0;}void nl() { cout << endl; } // Shortcut to just adding a blank line