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

C++ println函数代码示例

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

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



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

示例1: main

/**
 * @brief Main decoder function. It all starts here.
 * Input parameters:
 * 1) input JPEG 2000 image
 *
 * @return 0 on success
 */
int main(int argc, char **argv)
{
//	println_start(INFO);
	type_image *img = (type_image *)malloc(sizeof(type_image));
	memset(img, 0, sizeof(type_image));
	if((parse_args(argc, argv, img) == ERROR) || (check_args_dec(img) == ERROR))
	{
		fprintf(stderr, "Error occurred while parsing arguments.\n");
		fprintf(stdout, "%s", help);
		return 1;
	}

	type_parameters *param = (type_parameters*)malloc(sizeof(type_parameters));
	if((parse_config(img->conf_file, param) == ERROR) || (check_config(param) == ERROR)) {
		fprintf(stderr, "Error occurred while parsing configuration file.\n");
		fprintf(stdout, "%s", help);
		return 1;
	}

	init_device(param);

	FILE *fsrc = fopen(img->in_file, "rb");
	if (!fsrc) {
		fprintf(stderr, "Error, failed to open %s for reading\n", img->in_file);
		return 1;
	}

	type_tile *tile;
	int i;

	if(strstr(img->in_file, ".jp2") != NULL) {
		println(INFO, "It's a JP2 file");

		//parse the JP2 boxes
		jp2_parse_boxes(fsrc, img);
		fclose(fsrc);

		// Do decoding for all tiles
		for(i = 0; i < img->num_tiles; i++) {
			tile = &(img->tile[i]);
			/* Decode data */
			decode_tile(tile);
			/* Dequantize data */
			dequantize_tile(tile);
			/* Do inverse wavelet transform */
			iwt(tile);
		}

		if(img->use_mct == 1) {
			// lossless decoder
			if(img->wavelet_type == 0) {
				color_decoder_lossless(img);
			}
			else { //lossy decoder
				color_decoder_lossy(img);
			}
		} else if (img->use_part2_mct == 1) {
			decode_klt(img);
		} else {
			if(img->sign == UNSIGNED) {
				idc_level_shifting(img);
			}
		}
	}
	else {//It is not a JP2 file.
		type_buffer *src_buff = (type_buffer *) malloc(sizeof(type_buffer));

		init_dec_buffer(fsrc, src_buff);
		fclose(fsrc);

		decode_codestream(src_buff, img);

	//	get_next_box(fsrc);

		// Do decoding for all tiles
		for(i = 0; i < img->num_tiles; i++)	{
			tile = &(img->tile[i]);
			/* Decode data */
			decode_tile(tile);
			/* Dequantize data */
			dequantize_tile(tile);
			/* Do inverse wavelet transform */
			iwt(tile);
		}

		if(img->use_mct == 1) {
			// lossless decoder
			if(img->wavelet_type == 0) {
				color_decoder_lossless(img);
			}
			else {  //lossy decoder
				color_decoder_lossy(img);
			}
//.........这里部分代码省略.........
开发者ID:soulsheng,项目名称:gpu_jpeg2k,代码行数:101,代码来源:decoder.c


示例2: print

size_t Print::println(int num, int base)
{
  size_t n = print(num, base);
  n += println();
  return n;
}
开发者ID:aon3d,项目名称:Marlin,代码行数:6,代码来源:Print.cpp


示例3: main

/*
 * Application entry point.
 */
int main(void) {
  unsigned i;
  gptcnt_t interval, threshold, worst;

  /*
   * System initializations.
   * - HAL initialization, this also initializes the configured device drivers
   *   and performs the board-specific initializations.
   * - Kernel initialization, the main() function becomes a thread and the
   *   RTOS is active.
   */
  halInit();
  chSysInit();

  /*
   * Prepares the Serial driver 2 and GPT drivers 1 and 2.
   */
  sdStart(&SD1, NULL);          /* Default is 38400-8-N-1.*/
  gptStart(&GPTD1, &gpt1cfg);
  gptStart(&GPTD2, &gpt2cfg);

  /*
   * Initializes the mailboxes and creates the worker threads.
   */
  for (i = 0; i < NUM_THREADS; i++) {
    chMBInit(&mb[i], b[i], MAILBOX_SIZE);
    chThdCreateStatic(waWorkerThread[i], sizeof waWorkerThread[i],
                      NORMALPRIO - 20, WorkerThread, (void *)i);
  }

  /*
   * Test procedure.
   */
  println("");
  println("*** ChibiOS/RT IRQ-STORM long duration test");
  println("***");
  print("*** Kernel:       ");
  println(CH_KERNEL_VERSION);
#ifdef CH_COMPILER_NAME
  print("*** Compiler:     ");
  println(CH_COMPILER_NAME);
#endif
  print("*** Architecture: ");
  println(CH_ARCHITECTURE_NAME);
#ifdef CH_CORE_VARIANT_NAME
  print("*** Core Variant: ");
  println(CH_CORE_VARIANT_NAME);
#endif
#ifdef CH_PORT_INFO
  print("*** Port Info:    ");
  println(CH_PORT_INFO);
#endif
#ifdef PLATFORM_NAME
  print("*** Platform:     ");
  println(PLATFORM_NAME);
#endif
#ifdef BOARD_NAME
  print("*** Test Board:   ");
  println(BOARD_NAME);
#endif
  println("***");
  print("*** System Clock: ");
  printn(LPC11xx_SYSCLK);
  println("");
  print("*** Iterations:   ");
  printn(ITERATIONS);
  println("");
  print("*** Randomize:    ");
  printn(RANDOMIZE);
  println("");
  print("*** Threads:      ");
  printn(NUM_THREADS);
  println("");
  print("*** Mailbox size: ");
  printn(MAILBOX_SIZE);
  println("");

  println("");
  worst = 0;
  for (i = 1; i <= ITERATIONS; i++){
    print("Iteration ");
    printn(i);
    println("");
    saturated = FALSE;
    threshold = 0;
    for (interval = 2000; interval >= 20; interval -= interval / 10) {
      gptStartContinuous(&GPTD1, interval - 1); /* Slightly out of phase.*/
      gptStartContinuous(&GPTD2, interval + 1); /* Slightly out of phase.*/
      chThdSleepMilliseconds(1000);
      gptStopTimer(&GPTD1);
      gptStopTimer(&GPTD2);
      if (!saturated)
        print(".");
      else {
        print("#");
        if (threshold == 0)
          threshold = interval;
//.........这里部分代码省略.........
开发者ID:Ozhvankov,项目名称:STM32-GPS-Tracker,代码行数:101,代码来源:main.c


示例4: print

//************************************************************************
void Print::println(int n, int base)
{
	print(n, base);
	println();
}
开发者ID:UmbralCalculus,项目名称:chipKIT32-MAX,代码行数:6,代码来源:Print.cpp


示例5: show_usage

static void show_usage(const char *command)
{
	println("Usage: %s [option]", command);
	println("-H, -h, --help\t\t\t%s", cavan_help_message_help);
	println("-V, -v, --version\t\t%s", cavan_help_message_version);
	println("-I, -i, --ip IP\t\t\t%s", cavan_help_message_ip);
	println("--host [HOSTNAME]\t\t%s", cavan_help_message_hostname);
	println("-L, ---locall\t\t\t%s", cavan_help_message_local);
	println("-p, --port PORT\t\t\t%s", cavan_help_message_port);
	println("-A, -a, --adb\t\t\t%s", cavan_help_message_adb);
	println("--udp\t\t\t\t%s", cavan_help_message_udp);
	println("--unix, --unix-tcp [PATHNAME]\t%s", cavan_help_message_unix_tcp);
	println("--unix-udp [PATHNAME]\t\t%s", cavan_help_message_unix_udp);
	println("-P, --pt, --protocol PROTOCOL\t%s", cavan_help_message_protocol);
	println("-U, -u, --url [URL]\t\t%s", cavan_help_message_url);
	println("--na, --noack\t\t\texit don't need ack");
	println("-c, --cmdline\t\t\t%s", cavan_help_message_cmdline);
	println("--loop\t\t\t\tcycle to execute the command");
	println("--aloop\t\t\t\tuse adb and cycle to execute the command");
}
开发者ID:FuangCao,项目名称:cavan,代码行数:20,代码来源:tcp_keypad.c


示例6: println

void Adafruit_ESP8266::closeAP(void) {
  println(F("AT+CWQAP")); // Quit access point
  find(); // Purge 'OK'
}
开发者ID:BOBRAPHTONE,项目名称:Adafruit_ESP8266,代码行数:4,代码来源:Adafruit_ESP8266.cpp


示例7: ino

void serial::printlnX(int z) 
{
  ino(z);
  println();
  return;
}
开发者ID:ta3755,项目名称:MechArch,代码行数:6,代码来源:arduino_lib.c


示例8: main

/*
 * Application entry point.
 */
int main(void) {
  msg_t status = MSG_OK;
  systime_t tmo = MS2ST(4);

  /*
   * System initializations.
   * - HAL initialization, this also initializes the configured device drivers
   *   and performs the board-specific initializations.
   * - Kernel initialization, the main() function becomes a thread and the
   *   RTOS is active.
   */
  halInit();
  chSysInit();

  /*
   * Starts I2C
   */
  i2cStart(&I2CD2, &i2cfg2);

  /*
   * Prepares the Serial driver 2
   */
  sdStart(&SD2, NULL);          /* Default is 38400-8-N-1.*/
  palSetPadMode(GPIOA, 2, PAL_MODE_ALTERNATE(7));
  palSetPadMode(GPIOA, 3, PAL_MODE_ALTERNATE(7));

  /**
   * Prepares the accelerometer
   */
  txbuf[0] = ACCEL_CTRL_REG1; /* register address */
  txbuf[1] = 0x1;
  i2cAcquireBus(&I2CD2);
  status = i2cMasterTransmitTimeout(&I2CD2, mma8451_addr, txbuf, 2, rxbuf, 0, tmo);
  i2cReleaseBus(&I2CD2);

  if (status != MSG_OK){
    errors = i2cGetErrors(&I2CD2);
  }

  /*
   * Normal main() thread activity, nothing in this test.
   */
  while (TRUE) {
    palTogglePad(GPIOB, GPIOB_LED_B);
    chThdSleepMilliseconds(100);

    txbuf[0] = ACCEL_OUT_DATA; /* register address */
    i2cAcquireBus(&I2CD2);
    status = i2cMasterTransmitTimeout(&I2CD2, mma8451_addr, txbuf, 1, rxbuf, 6, tmo);
    i2cReleaseBus(&I2CD2);

    if (status != MSG_OK){
      errors = i2cGetErrors(&I2CD2);
    }

    acceleration_x = complement2signed(rxbuf[0], rxbuf[1]);
    acceleration_y = complement2signed(rxbuf[2], rxbuf[3]);
    acceleration_z = complement2signed(rxbuf[4], rxbuf[5]);

    print("x: ");
    printn(acceleration_x);
    print(" y: ");
    printn(acceleration_y);
    print(" z: ");
    printn(acceleration_z);
    println("");
  }
}
开发者ID:ChibiOS,项目名称:ChibiOS-gitmain,代码行数:71,代码来源:main.c


示例9: print_P

void
BetterStream::println_P(const char *s)
{
    print_P(s);
    println();
}
开发者ID:junxiangTan,项目名称:ardupirates,代码行数:6,代码来源:BetterStream.cpp


示例10: print

size_t Print::println(const __FlashStringHelper *ifsh)
{
  size_t n = print(ifsh);
  n += println();
  return n;
}
开发者ID:huaye,项目名称:github,代码行数:6,代码来源:Print.cpp


示例11: show_usage

static void show_usage(void)
{
	println("Usage:");
	println("usb_dd -w if=local_file of=remote_file");
	println("usb_dd -r if=remote_file of=local_file");
}
开发者ID:Jack19881218,项目名称:cavan,代码行数:6,代码来源:usb_dd.c


示例12: mp3_c

void mp3_c(u8 c){
	int i;
	static int over=0;
	
	if (cur_song.content_length == 0 || cur_song.content_remain == -1){
		print_c(c);
		if (c != '\n'){
			if (cur_song.buffer_idx < sizeof(cur_song.buffer)){
				cur_song.buffer[cur_song.buffer_idx++] = c;
			}
		}else{
			char * s = cur_song.buffer;
			
			if (s[0] == 'C' &&
					s[1] == 'o' &&
					s[2] == 'n' &&
					s[3] == 't' &&
					s[4] == 'e' &&
					s[5] == 'n' &&
					s[6] == 't' &&
					s[7] == '-' &&
					s[8] == 'L' &&
					s[9] == 'e' &&
					s[10]== 'n' &&
					s[11]== 'g' &&
					s[12]== 't' &&
					s[13]== 'h' &&
					s[14]== ':'){
				i = 16;
				while (i < 50 && s[i] >= '0' && s[i] <= '9'){
					cur_song.content_length = cur_song.content_length * 10 + (s[i] - '0');
					i++;
				}
				printf("-----content_length: %d\r\n",cur_song.content_length);
			}
			
			if (s[0]='\r' && cur_song.buffer_idx ==1 && cur_song.content_length > 0){
				cur_song.content_remain = cur_song.content_length;
				println("content_start");
			}
			
			cur_song.buffer_idx = 0;
		}
	}else{
		if (cur_song.content_remain > 0){
			// printf("%d\r\n",cur_song.content_remain);
			cur_song.content_remain--;
			cur_song.buffer[cur_song.buffer_idx++] = c;
			
			if (cur_song.content_length_without_id3v2 == 0 && cur_song.buffer_idx > 9){
				if (cur_song.buffer[0] == 0x49 &&
					  cur_song.buffer[1] == 0x44 &&
					  cur_song.buffer[2] == 0x33 ){
					cur_song.content_length_without_id3v2 = cur_song.content_length - 
							((cur_song.buffer[6]&0x7F)*0x200000+(cur_song.buffer[7]&0x7F)*0x4000+(cur_song.buffer[8]&0x7F)*0x80+(cur_song.buffer[9]&0x7F) + 10);
				}else{
					cur_song.content_length_without_id3v2 = cur_song.content_length;
					cur_song.first_head[0] = cur_song.buffer[0];
					cur_song.first_head[1] = cur_song.buffer[1];
					cur_song.first_head[2] = cur_song.buffer[2];
					cur_song.first_head[3] = cur_song.buffer[3];
					cur_song.headed = 4;
				}
			}
			
			if (cur_song.headed < 4 && cur_song.content_length_without_id3v2 > cur_song.content_remain ){
				cur_song.first_head[cur_song.headed++] = c;
			}
			
			if (cur_song.headed >= 4 && cur_song.frame_size == 0){
				for(i=0;i<4;i++) printf("0x%02x ",cur_song.first_head[i]);
				cur_song.frame_size = calc_frame_size(cur_song.first_head);
				
				printf("frame_size: %d\r\n",cur_song.frame_size);
			}
			
		}else{
			println("shot over");
			printf("content_over %d\r\n",over++);
		}
	}
}
开发者ID:crane-may,项目名称:cat_ear,代码行数:82,代码来源:main.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ printlog函数代码示例发布时间:2022-05-30
下一篇:
C++ printlist函数代码示例发布时间: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