文字の前に4つのスペースを入れるように、Cprintfのprintステートメントをどのようにフォーマットできるのか疑問に思いました。スペースの位置が変数によって事前に決定されている場合
int spaces = 4;
printf("Four spaces before the sentence gets printed")
出力が欲しい
" Four spaces before the sentence gets printed"
文字の前に4つのスペースを入れるように、Cprintfのprintステートメントをどのようにフォーマットできるのか疑問に思いました。スペースの位置が変数によって事前に決定されている場合
int spaces = 4;
printf("Four spaces before the sentence gets printed")
出力が欲しい
" Four spaces before the sentence gets printed"