C言語なら俺に聞け(入門篇) Part 20 at TECH
[2ch|▼Menu]
536:デフォルトの名無しさん
07/10/29 15:26:38
>>533
opはオペレーションNoの取得なので、1文字です。
指定文字列の取得はchar str[100]に入れています。
>scanf("%s", str);

>>535
1文字入力の%cで
>scanf("%c", &op);
と変えてみました。
キューには格納されているようですが、変な出力結果になってしまいます。

実行結果
Operation(0:enqueue 2:quit)0
input string : ab
String Queue : [ab]
head[0] tail[1]
Operation(0:enqueue 2:quit)invalid ope number!
head[0] tail[1]
Operation(0:enqueue 2:quit)0
input string : bc
String Queue : [ab] [bc]
head[0] tail[2]
Operation(0:enqueue 2:quit)invalid ope number!
head[0] tail[2]
Operation(0:enqueue 2:quit)


次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

5264日前に更新/251 KB
担当:undef