y‰SŽÒнŒ}zC/C++Ž ..
472:ƒfƒtƒHƒ‹ƒg‚Ì–¼–³‚µ‚³‚ñ
08/02/11 21:00:10
æ‚ÉŽ¿–₵‚½‚à‚̂ł·B
icc‚ɂ‚¢‚Ă̎¿–â‚Ȃ̂ł·‚ªA-Wall•t‚«‚ŃRƒ“ƒpƒCƒ‹‚·‚邯‘òŽRŒx‚ª‚ł܂·B
‚±‚ê‚ç‚ÌŒx‚͑Ήž‚·‚ׂ«‚Ȃ̂łµ‚傤‚©H
$ icc test.cpp -Wall
test.cpp(5): remark #1418: external function definition with no prior declaration
double g(double s) {
^test.cpp(6): remark #383: value copied to temporary, reference to temporary used return std::max(s - 100.0, 0.0);
test.cpp(6): remark #981: operands are evaluated in unspecified order return std::max(s - 100.0, 0.0);
‚±‚±‚ÅŽg‚Á‚Ä‚¢‚éƒ\[ƒX‚Í‚±‚ê‚Å‚·B
#include <iostream>
using namespace std;
double g(double s) {
return std::max(s - 100.0, 0.0);
}
int main()
{
double x = 150.0;
cout << g(x) << endl;
return 0;
}
ŽŸƒy[ƒW‘±‚«‚ð•\ަ1‚ð•\ަÅVƒŒƒX•\ަƒXƒŒƒbƒh‚ÌŒŸõ—ÞŽ—ƒXƒŒˆê——˜b‘è‚̃jƒ…[ƒX‚¨‚Ü‚©‚¹ƒŠƒXƒg¥ƒIƒvƒVƒ‡ƒ“‚ð•\ަ‰É‚‚Ԃµ2ch
4943“ú‘O‚ÉXV/249 KB
’S“–:undef