int main(){

	int num1 = 3;  // object to act on with my functions

	int *pint;     // pointer to object to be passed to my functions
	pint = &num1;

	myint num2;
	num2.value = 6;

	std::cout << "num1 = " << num1 << std::endl;

	doubler(num1);  // by reference
	std::cout << "AFTER doubler num1 = " << num1 << std::endl;
	
	doubler(*pint);  // by reference
	std::cout << "AFTER doubler num1 = " << num1 << std::endl;
	
	tripler(pint);  // by pointer
	std::cout << "AFTER tripler num1 = " << num1 << std::endl;
	
	tripler(&num1); // by another pointer
	std::cout << "AFTER tripler num1 = " << num1 << std::endl;
	
///////////////////////////////////	
	
	std::cout << "num2 = " << num2.value << std::endl;
	
	plusone(&num2);  // by struct pointer
	std::cout << "AFTER plusone num2 = " << num2.value << std::endl;

	return 0;
}
Example #2
0
int sted()
{
	for(;;)
	{
		clear();
		refresh();
		wprintw(stdscr, "To add a character type press 1.\nTo view an character type press 4.\nTo save the enemy file press 7.\nTo save the enemy file under a different name press 8.\nTo edit enemies press 9\nTo delete a character type press 0.\n");
		input [0] = bie();
		if(input[0] == '1')
			addst();
		if(input[0] == '4')
			viewst();
		if(input[0] == '7')
			savest(filename);
		if(input[0] == '8')
		{
			stufffilename();
			savest(filename);
		}
		if(input[0] == '9')
			break;
		if(input[0] == '.')
			plusone(3);
		if(input[0] == ',')
			minusone(3);
		if(input[0] == '/')
			checkone(3);
		if(input[0] == '0')
			clearst();
		wprintw(stdscr, "Press any key to continue.\n");
		bie();
	}
	return 0;
}
Example #3
0
static void  savepoly(poly p)
{

 int width;
 char * b, *e;
 poly zero=plusone();

 zero->num=0;    
 
 b=(char*)&(zero->num);
 if(vardef->nvar) e=(char*)&(zero->power[vardef->vars[vardef->nvar-1].wordpos]); 
       else       e=(char*)&(zero->power[0]); 
 width=e-b;
 
 while(p) { if(fwrite(&(p->num),width,1,archiv)!=1) wAbort(); p=p->next; }

 if(fwrite(&(zero->num),width,1,archiv)!=1) wAbort();  

}
Example #4
0
int itgred()
{
	for(;;)
	{
		clear();
		refresh();
		wprintw(stdscr, "To add an item group press 1.\nTo view an item group press 4.\nTo save the enemy file press 7.\nTo save the enemy file under a different name press 8.\nTo edit items press 9\nTo delete an item group press 0.\n");
		input [0] = bie();
		if(input[0] == '1')
			additgr();
		if(input[0] == '4')
			viewitgr();
		if(input[0] == '7')
			saveen(filename);
		if(input[0] == '8')
		{
			stufffilename();
			saveen(filename);
		}
		if(input[0] == '9')
			break;
		if(input[0] == '.')
			plusone(6);
		if(input[0] == ',')
			minusone(6);
		if(input[0] == '/')
			checkone(6);
		if(input[0] == '0')
			clearitgr();
		wprintw(stdscr, "Press any key to continue.\n");
		bie();
	}
	if(input[0] == '9')
		ited();
	return 0;
}
Example #5
0
int chared()
{
	for(;;)
	{
		clear();
		refresh();
		wprintw(stdscr, "To add a character press 1.\nTo view a character press 4.\nTo save the enemy file press 7.\nTo save the enemy file under a different name press 8.\nTo edit equations press 9\nTo delete a character press 0.\n");
		input [0] = bie();
		if(input[0] == '1')
			addcha();
		if(input[0] == '4')
			viewch();
		if(input[0] == '7')
			saveen(filename);
		if(input[0] == '8')
		{
			stufffilename();
			saveen(filename);
		}
		if(input[0] == '9')
			break;
		if(input[0] == '.')
			plusone(1);
		if(input[0] == ',')
			minusone(1);
		if(input[0] == '/')
			checkone(1);
		if(input[0] == '0')
			clearch();
		wprintw(stdscr, "Press any key to continue.\n");
		bie();
	}
	if(input[0] == '9')
		eqed();
	return 0;
}
Example #6
0
int  M(int  n)
{
  if (n == 0)
    return 0;
  return plusone(n) - 1 - G(M(n - 1));
}
Example #7
0
void PlusOne(const v8::FunctionCallbackInfo<v8::Value>& args){
  args.GetReturnValue().Set(plusone(args[0]->IntegerValue(args.GetIsolate()->GetCurrentContext()).FromJust()));
}
Example #8
0
void PlusOneScoped(const v8::FunctionCallbackInfo<v8::Value>& args){
  v8::Isolate* isolate = args.GetIsolate();
  v8::HandleScope scope(isolate);
  
  args.GetReturnValue().Set(plusone(args[0]->IntegerValue(args.GetIsolate()->GetCurrentContext()).FromJust()));
}
Example #9
0
int M(int n) {  
	if ( n < 2 ) return 1; 	
	plusone(&n);
	return  n - 1 - G(n - 1);
} 
Example #10
0
int main()
{
    printf("Nr: %d\n", plusone(5));
}