switch(select){ case 1: inputs(0); //Yを入れてるのに特に意味はない 再帰でつかいたかっただけ。 break; case 2: bookserch(0); break; case 3: nameserch(0); break; case 4: save(); break; case 5: load(); break; case 6: exit(0); break; }
printf("Please enter a number:\n"); scanf("%d",&n1); printf("Please enter the other number:\n"); scanf("%d",&n2); printf("Your entered number are: %d %d\n",n1,n2);
>>94 わからない。 ちなみにSunOS+gccでも > Please enter a number: > hoge ← これを入力 > Please enter the other number: > Your entered number are: 0 0 となる FreeBSDは今手元にないので確認できない
$ ./a.out Please enter a number: 0 Please enter the other number: 1 Your entered number are: 0 1 $ ./a.out Please enter a number: hoge Please enter the other number: Your entered number are: 134518476 134518256
ついでだから $ ./a.out Please enter a number: 12 34 Please enter the other number: Your entered number are: 12 34 $ ./a.out Please enter a number: 23hoge Please enter the other number: Your entered number are: 23 134518256
typedef struct tagList{ short x; short y; short movx; short movy; short flg; char *next; }LIST; -----・・・ /*mainから。*/ ladd(&emp,&mblt);/* LIST *emp,*mblt */
>417 C言語のswitch文では範囲の指定はできないです。 別のやり方としては、caseの部分を重ねて書く方法もありますが、これだと値があらかじめ特定されてないと使えません。 switch(a){ case 100: case 200: case 300: case 400: /*ここで処理*/ }
あの今独学で本を見ながらCを勉強している(まだ3日目)のですが、 microsoft visual c++ 6.0でビルドしてできたプログラムを そのままvisualC上で実行すると、実行後にDOS窓が表示されたまま止まるのですが、 winでさっきのexeファイルを実行するとプログラムが実行された後、すぐに DOS窓が閉じてしまって結果が確認できません。 終わっても窓を閉じさせないようにはどのようにすればいいのでしょうか? 本にも書いてないし困ってます。どなたか教えてくださいませんか?
>>610 if (a == 0) の書き間違えで if (a = 0) になるとコンパイルエラーにならないが(警告は出るかも) 普段から if (0 == a) ってやっとくと if (0 = a) でエラーになるから 致命傷にならなくて済む、って説明が「エキスパートCプログラミング」に あったような。俺もそれ読んで一時期 if (0 == a) 使ってたけど、 すぐやめちゃった(なんか気持ち悪いから)
>>645 すまん。localtime()の引数の由来は知らんのだが、 man localtime したら
>>643 The function localtime() converts the time value pointed at by clock, and returns a pointer to a ``struct tm'' ... ^^^^^^^^^^^^^^^^^ こんな例も見つけてしまった。 確かに「ポインターを返す」っていうけど、これって「アドレスを格納する 変数を返す」って意味じゃないもんなー。
#define DBL_DIG 15 /* # of decimal digits of precision */ #define DBL_MAX 1.7976931348623158e+308 /* max value */ #define DBL_MIN 2.2250738585072014e-308 /* min positive value */ まんま書いてあるじゃん。 桁数、15 最大値、1.7976931348623158x10^308 最小値、2.2250738585072014x10^-308
そこでいきなりつまったのですが、73行目に次のようなものがありました。 int main __P((int argc, char *argv[])); この後にmain関数があるのでこれはmain関数では無いとして、 mainと__Pの間のスペースは何なんでしょうか? こんな関数宣言は勉強してるとき出て来なかったんですが...
>>729 > あちこちからライブラリとってくるとか、 Linux だとデフォルトで開発環境が入らんディストリビューションもあるからな。 ただ、それはディストリビューション依存だから、ここで聞くより Linux 板あたり のディストリビューションごとのスレで聞いた方が良いと思われ。 (っつか開発者として使うなら Linux より *BSD の方が楽だぞ)
> CVS鯖の用意 一人で使うなら、共用のサーバーは要らん。環境変数 CVSROOT 設定して cvs -init で終わりだ。それ以上は google 行けば解説がいくらでも見つかる。