示例#1
0
文件: addone.cpp 项目: Yunaik/asp
int main(){
int a = 5;
int b = 0;
printf("b: %i", b);
AddOne(b);
printf("b: %i", b);
}
示例#2
0
文件: log.cpp 项目: OLR-xray/XRay-NEW
void Log				(const char *s)
{
    int		i,j;
    char	split[1024];

    for (i=0,j=0; s[i]!=0; i++) {
        if (s[i]=='\n') {
            split[j]=0;	// end of line
            if (split[0]==0) {
                split[0]=' ';
                split[1]=0;
            }
            AddOne(split);
            j=0;
        } else {
            split[j++]=s[i];
        }
    }
    split[j]=0;
    AddOne(split);
}
示例#3
0
void Log				(const char *s) 
{
	int		i,j;

	u32			length = xr_strlen( s );
#ifndef _EDITOR    
	PSTR split  = (PSTR)_alloca( (length + 1) * sizeof(char) );
#else
	PSTR split  = (PSTR)alloca( (length + 1) * sizeof(char) );
#endif
	for (i=0,j=0; s[i]!=0; i++) {
		if (s[i]=='\n') {
			split[j]=0;	// end of line
			if (split[0]==0) { split[0]=' '; split[1]=0; }
			AddOne(split);
			j=0;
		} else {
			split[j++]=s[i];
		}
	}
	split[j]=0;
	AddOne(split);
}
示例#4
0
文件: passbyref.cpp 项目: mohitsh/cpp
int main(){

	// PASS BY REFERENCE

	// original arguments are modeified in pass by reference
	// no need to return back anything
	// because original array is modified to job done

	int x = 5;
	std::cout << "x " << x << "\n";
	
	foo(x);
	std::cout << "after calling foo " << x << "\n";
	
	AddOne(x);
	std::cout << "should be 7 " << x << "\n";

}
示例#5
0
文件: chull.c 项目: sleitner/cart
/*---------------------------------------------------------------------
ConstructHull adds the vertices to the hull one at a time.  The hull
vertices are those in the list marked as onhull.
---------------------------------------------------------------------*/
void	ConstructHull( void )
{
   tVertex  v, vnext;

   v = vertices;
   do {
      vnext = v->next;
      if ( !v->mark ) {
         v->mark = PROCESSED;
	 AddOne( v );
	 CleanUp( &vnext ); /* Pass down vnext in case it gets deleted. */

	 if ( check ) {
	    fprintf(stderr,"ConstructHull: After Add of %d & Cleanup:\n", 
               v->vnum);
	    Checks();
	 }
	 if ( debug )
            PrintOut( v );
      }
      v = vnext;
   } while ( v != vertices );
}