• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ print_out函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中print_out函数的典型用法代码示例。如果您正苦于以下问题:C++ print_out函数的具体用法?C++ print_out怎么用?C++ print_out使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了print_out函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

int main(int argc, char **argv)
{
  int ret;

  while((ret=getopt_clone(argc,argv,piip)) != GETOPT_RETURN_LAST)
  {
    if(ret == GETOPT_RETURN_FAILURE)
      return 1;

    else if(ret == GETOPT_RETURN_NORMAL)
    {
      print_out("Normal parameter at pos %d: \"%s\"\n",nextpos,
        optarg_clone);
    }
    else
    {
      print_out("Flag argument at pos %d: %d\"--%s\"",nextpos,ret,
        piip[ret].longflag);
      if(optarg_clone)
        print_out(" with argument \"%s\"",optarg_clone);
      print_out("\n");
    }
  }
  return 0;
}
开发者ID:kopoli,项目名称:tgwopen,代码行数:25,代码来源:getopt_clone.c


示例2: main

int main(int argc,char *argv[])
{
  Seg_list seg_list;
  Point_list_list output_list;

  Number_Type prec;

  if (!read_data(argc,argv,prec,seg_list))
    return -1;

  CGAL::snap_rounding_2<Sr_traits, Seg_list::const_iterator,
                        Point_list_list>(seg_list.begin(),
                                         seg_list.end(),
                                         output_list,
                                         prec, true, false, 3);

  std::cout << "input segments" << std::endl;
  std::list<Segment_2>::iterator i1;
  for (i1 = seg_list.begin(); i1 != seg_list.end(); ++i1)
    std::cout << *i1 << std::endl;

  std::cout << std::endl << "the output" << std::endl;
  print_out(output_list.begin(),output_list.end());

  std::cout << std::endl << "testing sr" << std::endl;
  output_list.clear();
  CGAL::snap_rounding_2<Sr_traits, Seg_list::const_iterator,
                        Point_list_list>(seg_list.begin(),
                                         seg_list.end(),
                                         output_list,
                                         prec, false, false, 3);
   print_out(output_list.begin(),output_list.end());

   return(0);
}
开发者ID:Fox-Heracles,项目名称:cgal,代码行数:35,代码来源:test.cpp


示例3: unmake

/* 0 if everything is solved, -1 on error, 1 on partial success */
static inline int unmake(struct level *level) {
    cell_t *map = level->map;
    int pos = 0, local_depth = level->solution_depth;

#ifndef ONLINE_JUDGE
        print_out(map, level->knowledge);
        printf(" ||%d\n \\/\n", local_depth);
#endif
    while (map[pos] != 1)
        pos++;
    while (pos < area) {
        if (untake_bacteria(map, pos))
            return -1;
        solution[local_depth++] = pos;
        if (local_depth == area)
            return 0;
#ifndef ONLINE_JUDGE
        print_out(map, level->knowledge);
        printf(" ||%d (%d)\n \\/\n", local_depth, pos);
#endif
        if (map[up[pos]] == 1)
            pos = up[pos];
        else if (map[left[pos]] == 1)
            pos = left[pos];
        else /* fast-forward to next 1 */
            while (map[pos] != 1)
                pos++;
    }
    level->solution_depth = local_depth;
    return local_depth != area;
}
开发者ID:aragaer,项目名称:bact,代码行数:32,代码来源:yab.c


示例4: print_version

void print_version()
{
    print_out(" ");
    print_out("%s %s - %s", __name, __version, __author);
    print_out(" ");
    print_out("%s",__license);
    exit(1);
}
开发者ID:jrossi,项目名称:ossec-hids-old-unused,代码行数:8,代码来源:help.c


示例5: Interrupt_Handler

/**
	Service event to wait on an I/O operation.

	This function services requests to check an I/O operation for completion.
	If the operation is complete, the process resumes execution immediately;
	otherwise, the process is blocked.

	<b> Important Notes:</b>
	\li Events of type WIO_EVT will result in this call via
	Interrupt_Handler() in simulator.c after interrupt() in obj1.c sets the
	global Event variable.
	\li WIO, unlike SIO, is a blocking I/O operation. As such, the program
	causing the event will be blocked (removed from the ready queue or from the
	CPU) after this event is serviced. However, if I/O had already been
	started from an earlier SIO event, then the process may be able to
	continue, but only if the I/O request has already been completed.
	\li Retrieving the request instruction (REQ) from memory is done similarly
	to finding the device ID in Alloc_rb(). The saved CPU information is used
	to find the necessary segment in the PCB's segment table. Once the segment
	has been found, the segment base is added to the current PC offset (minus
	1) to get the position in memory that the request instruction is located
	at.
	\li The request instruction's operand, which is an address, should be
	passed to Find_rb() to find the needed request block as the request address
	holds information pointing to the device being waited on.

	<b> Algorithm: </b>
	\verbatim
	Retrieve pcb from the terminal table that is waiting for I/O

	Retrieve request instruction using saved CPU information

	Locate request block that process wants to wait for--call Find_rb()

	Determine status of request block
		If rb is still active or pending
			Block process since I/O not finished:
				Mark PCB as blocked; mark it

				Turn CPU and scheduling switches on to schedule a new process

				Calculate active time for process and busy time for CPU

				Record time process was blocked

				Print output message giving blocked procese and burst count

		If rb has finished
			Delete it and keep running current process:
				Delete rb from pcb's list

				Turn CPU switch on to execute a process
				Turn scheduling flag off to use current process (i.e., not schedule a new process)

	\endverbatim
 */
void
Wio_Service( )
{
    //Retrieve pcb from the terminal table that is waiting for I/O
    //~ pcb_type *pcb = Term_Table[Agent-1];
    pcb_type *pcb = Term_Table[Agent - 1]->rb_q->rb->pcb;

    //Retrieve request instruction using saved CPU information
    //~ instr_type instr = Mem[pcb->seg_table[pcb->cpu_save.pc.segment].base + pcb->cpu_save.pc.offset-1];
    instr_type instr = Mem[pcb->seg_table[pcb->cpu_save.pc.segment].base + CPU.state.pc.offset-1];

    //Locate request block that process wants to wait for--call Find_rb()
    rb_type *rb = Find_rb(pcb, &instr.operand.address);

    //Determine status of request block
    //If rb is still active or pending
    if(rb->status == ACTIVE_RB || rb->status == PENDING_RB)
    {
        //Block process since I/O not finished:
        //Mark PCB as blocked; mark it
        pcb->status = BLOCKED_PCB;

        //Turn CPU and scheduling switches on to schedule a new process
        CPU_SW = ON;
        SCHED_SW = ON;

        //Calculate active time for process and busy time for CPU
        time_type currTime = Clock;
        Diff_time(&pcb->run_time, &currTime);
        Add_time(&currTime, &(pcb->total_run_time));
        Add_time(&currTime, &(CPU.total_busy_time));

        //Record time process was blocked
        pcb->block_time = Clock;

        pcb->wait_rb = rb;

        //Print output message giving blocked procese and burst count
        print_out("\t\tUser %s is blocked for I/O.\n", pcb->username);
        print_out("\t\tCPU burst was %d instructions.\n\n",pcb->sjnburst);
    }

    //If rb has finished
    if(rb->status == DONE_RB)
//.........这里部分代码省略.........
开发者ID:finesthours,项目名称:COP4600-OS-Project,代码行数:101,代码来源:obj4.c


示例6: print_flags

/* Prints the helptext for options in a generated form */
static tvalue print_flags(option_clone *opts,
  gen_cli_helpstr *opts_explain,
  unsigned int arglen,unsigned int cols)
{
  register unsigned int beta=0, gamma;
  unsigned int optcount = 0, curlen;
  unsigned int conslen = PRINTSPACELEN+2;

  if(opts)
    while(opts[optcount].longflag != NULL || opts[optcount].has_arg != 0
      || opts[optcount].shortflag != 0)
      optcount++;

  /* do the printing */
  for(beta = 0; beta < optcount; beta++)
  {
    curlen = conslen;

    print_out(PRINTSPACE);
    if(opts[beta].shortflag != 0)
      print_out("-%c", opts[beta].shortflag);

    if(opts[beta].longflag != NULL)
    {
      curlen += 4 + strlen(opts[beta].longflag);

      if(opts[beta].shortflag != 0)
        iolet_out_char(IL_IOStd,',');

      else
        print_out("   ");

      print_out(" --%s", opts[beta].longflag);

      if(opts_explain[beta].arg != NULL)
      {
        curlen += 1 + strlen(opts_explain[beta].arg);
        print_out(" %s", opts_explain[beta].arg);
      }
    }

    for(gamma = curlen; gamma < arglen; gamma++)
      iolet_out_char(IL_IOStd,' ');
  
    print_explain(arglen, opts_explain[beta].desc,cols);
  }

  iolet_out_char(IL_IOStd,'\n');

  return TRUE;
}
开发者ID:kopoli,项目名称:tgwopen,代码行数:52,代码来源:gen_cli.c


示例7: help_logcollector

/* print help statement */
static void help_logcollector()
{
    print_header();
    print_out("  %s: -[Vhdtf] [-c config]", ARGV0);
    print_out("    -V          Version and license message");
    print_out("    -h          This help message");
    print_out("    -d          Execute in debug mode. This parameter");
    print_out("                can be specified multiple times");
    print_out("                to increase the debug level.");
    print_out("    -t          Test configuration");
    print_out("    -f          Run in foreground");
    print_out("    -c <config> Configuration file to use (default: %s)", DEFAULTCPATH);
    print_out(" ");
    exit(1);
}
开发者ID:pochadri,项目名称:ossec-hids,代码行数:16,代码来源:main.c


示例8: print_out

void print_out(unsigned int n)
{
	if(n >= 10)
		print_out(n / 10);

	printf("%d\n", n % 10);
}
开发者ID:xiongyejun,项目名称:02-c,代码行数:7,代码来源:00-print_out.c


示例9: helpmsg

/* print help statement */
void helpmsg()
{
    print_header();
    print_out("  %s: -[Vhl] [-e id] [-r id] [-i id] [-f file]", ARGV0);
    print_out("    -V          Version and license message");
    print_out("    -h          This help message");
    print_out("    -l          List available agents.");
    print_out("    -e <id>     Extracts key for an agent (Manager only)");
    print_out("    -r <id>     Remove an agent (Manager only)");
    print_out("    -i <id>     Import authentication key (Agent only)");
    print_out("    -f <file>   Bulk generate client keys from file (Manager only)");
    print_out("                <file> contains lines in IP,NAME format");
    exit(1);
}
开发者ID:folpindo,项目名称:ossec-hids,代码行数:15,代码来源:main.c


示例10: parse_elf

uint64_t parse_elf(char* path) {
	
	uint64_t parse_ptr = (uint64_t)&_binary_tarfs_start;
	struct posix_header_ustar* ptr;
	uint64_t size;	
	uint64_t remainder;
		//print_out("   name is %s ",parse_ptr->name);
		//print_out("  size id %s",parse_ptr->size);

	while(parse_ptr < (uint64_t)&_binary_tarfs_end) {

		ptr = (struct posix_header_ustar *) (parse_ptr);
		if(ptr->name[0] == '\0') {
			parse_ptr += 512;
			continue;
		}
		//print_out("   name is %s ",ptr->name);
		//print_out("  size is %s",ptr->size);
		size = atoi_t(ptr->size);
		
		//print_out("  size is %d",size);
		
		parse_ptr += (512);

		//if(xstrcmp(ptr->name,"bin/hello")) 
		if(xstrcmp(ptr->name,path)) 
			break;	
		
		if(size > 0) {
			remainder = size % 512UL;
			//print_out("  remainder is %d ",remainder);
			parse_ptr += (size + 512 - remainder);
		}
			
	}
	
	struct parse_info *loadptr;
	clear_screen();
	loadptr = elf_parser(parse_ptr);
	print_out("\n ---- \nentry point is %x",loadptr->entry_point);
	print_out("\n file start ptr is %x",loadptr->file_start_ptr);
	
	struct load_info* temp = loadptr->load_list;
	while(temp != NULL){
		print_out("\n File offset is %d",temp->file_offset);	
		print_out("\n virtual addr is %x",temp->v_addr);
		print_out("\n File seg size is %d",temp->file_seg_size);
		print_out("\n Mem seg size is %d",temp->mem_seg_size);	
		print_out("\n Flags are %d",temp->flags);	
		temp = temp->next;
	}

	
	return parse_ptr;


	
	
}
开发者ID:KVSamhitha,项目名称:CLI-OS,代码行数:59,代码来源:parse_elf.c


示例11: print_command_path

static tvalue print_command_path(char *prog_name,gen_cli_argument *arg)
{
  register gen_cli_argument *beta=arg;
  register unsigned int gamma=0;
  unsigned int count=0,constcount;
  char **cmds=NULL;
  
  if(!arg)
    return FALSE;

  /* count the number of supcommands */
  while(beta != NULL && beta->prev != NULL)
  {
    count++;
    beta=beta->prev;
  }

  cmds=use_malloc(count*sizeof(char *));
  if(!cmds)
  {
    print_err("Error: Ran out of memory in helpprinting.\n");
    return FALSE;
  }

  constcount=count;

  /* copy the pointers */
  beta=arg;
  while(count > 0)
  {
    count--;
    cmds[count] = beta->cmd;
    beta=beta->prev;
  }

  print_out("%s",prog_name);
  for(gamma=0;gamma<constcount;gamma++)
    print_out(" %s",cmds[gamma]);

  nullify(cmds);
  return TRUE;  
}
开发者ID:kopoli,项目名称:tgwopen,代码行数:42,代码来源:gen_cli.c


示例12: main

int main(void)
{
	unsigned int n;

	n = 120304;

	printf("n = %d\n", n);
	void print_out(unsigned int n);	
	print_out(n);	
	return 0;
}	
开发者ID:xiongyejun,项目名称:02-c,代码行数:11,代码来源:00-print_out.c


示例13: print_out

void *Action_FP(Eventinfo *lf, char *field)
{
#ifdef TESTRULE
    if (!alert_only) {
        print_out("       action: '%s'", field);
    }
#endif

    lf->action = field;
    return (NULL);
}
开发者ID:Defensative,项目名称:ossec-hids,代码行数:11,代码来源:decoder.c


示例14: main

void main(int argc, char *argv[]) {
        if (argc!=1) {
                printf("Sorry, I don't take command line arguments.\n");
                exit(-1);
	}
        else {
		get_first();
		get_matrices();
		mul_matrices();
		print_out();
	}
}
开发者ID:aclark4life,项目名称:CS,代码行数:12,代码来源:duh.c


示例15: print_help

static void print_help()
{
    print_out(
        "Usage:  " + NCore::applicationBasenameName() + " [[option] | [files]]\n"
        "\n"
        "Options:\n"
        "    --next         play next file\n"
        "    --prev         play previous file\n"
        "    --stop         stop playback\n"
        "    --pause        pause playback\n"
        "    --version      print version\n"
        "    -h, --help     print this message\n"
    );
}
开发者ID:nulloy,项目名称:nulloy,代码行数:14,代码来源:main.cpp


示例16: motor_eq

void motor_eq (double t, struct input *in, struct param *parms, double h) {

	double i,w_last,t_last,phih,rest,P,*PP,mean,change,P_last;
	int j,k,Plen,interv,runs=0;
	
	struct output out;
	struct vector v_next;
	
	interv = 10;
	Plen = (int)(t*(1/h));
	out.sig = 1;
	change = 100;	

	v_next.ia = 0;
	v_next.ib = 0;
	v_next.ic = 0;
    	v_next.w = 2 / (parms->r/(2*PI));
	out.P = 0;

	for (i=0;i<t;i+=h) {
		
		w_last = v_next.w;
		t_last = v_next.t;
		P_last = out.P;
/*
		if (i > change) {
			out.sig = (out.sig+1)%2;
			change += 100;
		}
*/

        	step_diff(&v_next,in,&out,parms,h);

		out.phi += h*(v_next.w + w_last)/2.0;

		out.ia = v_next.ia;
        	out.ib = v_next.ib;
        	out.ic = v_next.ic;
		out.v = v_next.w * (parms->r/(2*PI));
		out.Te = out.a * parms->J;
		out.s = v_next.s;
		out.P = v_next.P;

		if ((runs % 1000) == 0) {
			print_out(&out,t);
		}
		runs++;
	}
}
开发者ID:MaxSchachti,项目名称:motparmopti,代码行数:49,代码来源:motorModell.c


示例17: kern_sleep

void kern_sleep(uint16_t sec) {
	uint16_t * sleep_sec = (uint16_t *)0xfffffe0000000000;
	sleep_sec[0] = (uint16_t)sec;
	print_out("...The sleep count will be set to %d...",sleep_sec[0]);
        __asm__ volatile(
                "mov $0x83,%%eax;"
                " int $0x83;"
                :
                :
                :"memory"
                );
	uint64_t * sleep_wait = (uint64_t *)0xfffffe0000000000;
	sleep_wait[0] = 10000000;
	while(sleep_wait[0] > 0)
		sleep_wait[0]--;
}
开发者ID:ravikiranp,项目名称:SBUnix,代码行数:16,代码来源:syscalls.c


示例18: main

int main(int argc, char *argv[]) {
	char line[LINE_LENGTH];
	char clockface[51][51];
	char cf_fin[51][51];
	argc = argc;
	argv = argv;
	int hour, min;
	init(clockface);
	
	
/*	while (true)*/
	{
		hour = (getchar()-'0')*10;
		hour += (getchar()-'0');
		getchar();
		min = (getchar()-'0')*10;
		min += (getchar()-'0');
		big = true;
		double mAng = min*6;
		
		double hAng = (hour*6+(min/3600));
		
		doMin(mAng, clockface, cf_fin);
		big = false;
		doMin(hAng, clockface, cf_fin);
		
		doit();
		
		//~ if ()
			//~ break;
	}


	//*************8
	//double mAng = 18;
	//doMin(mAng, clockface, cf_fin);
//	double hAng = 
	
	//*************8
	modify_pic(clockface, cf_fin);
	
	
	print_out(cf_fin);
	
	return 0;
}
开发者ID:elieux,项目名称:problems,代码行数:46,代码来源:analog.c


示例19: run

static void run() {
	Channel *c;
	int r, maxfd;
	fd_set rd;
	struct timeval tv;
	char ping_msg[512];

	snprintf(ping_msg, sizeof(ping_msg), "PING %s\r\n", host);
	for(;;) {
		FD_ZERO(&rd);
		maxfd = irc->irc;
		FD_SET(irc->irc, &rd);
		for(c = channels; c; c = c->next) {
			if(maxfd < c->fd)
				maxfd = c->fd;
			FD_SET(c->fd, &rd);
		}

		tv.tv_sec = 120;
		tv.tv_usec = 0;
		r = select(maxfd + 1, &rd, 0, 0, &tv);
		if(r < 0) {
			if(errno == EINTR)
				continue;
			perror("ii: error on select()");
			exit(EXIT_FAILURE);
		} else if(r == 0) {
			if(time(NULL) - last_response >= PING_TIMEOUT) {
				print_out(NULL, "-!- ii shutting down: ping timeout");
				exit(EXIT_FAILURE);
			}
			WRITE(irc, ping_msg, strlen(ping_msg));
			continue;
		}
		if(FD_ISSET(irc->irc, &rd)) {
			handle_server_output();
			last_response = time(NULL);
		}
		for(c = channels; c; c = c->next)
			if(FD_ISSET(c->fd, &rd))
				handle_channels_input(c);
	}
}
开发者ID:hedbuz,项目名称:ii,代码行数:43,代码来源:ii.c


示例20: kern_fork

uint64_t kern_fork() {
	uint64_t * ret_addr = (uint64_t *)0xfffffe0000000000;
	__asm__ volatile(
		"movq 8(%%rsp),%0;"
		:"=r"(*ret_addr)
		:
		:"memory"
		);
	__asm__ volatile(
		"mov $0x81,%%eax;"
                "int $0x81;"
		:
		:
		:"memory"
		);
	uint64_t * ret_val = (uint64_t *)0xffffff7fbfdfefe8;
	print_out(" The ret value is %d   ",ret_val[0]);
	return ret_val[0];		
}
开发者ID:ravikiranp,项目名称:SBUnix,代码行数:19,代码来源:syscalls.c



注:本文中的print_out函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ print_output函数代码示例发布时间:2022-05-30
下一篇:
C++ print_on函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap