當前位置

首頁 > 商務英語 > 計算機英語 > c語言中puts的用法

c語言中puts的用法

推薦人: 來源: 閱讀: 1.84W 次

c語言中puts的用法的用法你知道嗎?下面小編就跟你們詳細介紹下c語言中puts的用法的用法,希望對你們有用。

ing-bottom: 66.56%;">c語言中puts的用法

  c語言中puts的用法的用法如下:

puts就是輸出字符串啊。

int puts(

const char* string

);

MSDN的例子

/* PUTS.C: This program uses puts

* to write a string to stdout.

*/

#include <stdio.h>

void main( void )

{

puts( "Hello world from puts!" );

}

運行結果就是

Hello world from puts!

你要輸出換行的話,就用 puts( "n" );

用法很簡單啊,就是把一個C樣式的字符串當參數傳過去。

//-----------------------------------------

我剛剛試過了

puts( "" )的確可以起到換行的作用。

The puts function writes string to the standard output stream stdout, replacing the string's terminating null character ('