找回密码
 立即注册
搜索
楼主: 叮叮

超级C++新手问题..

[复制链接]
头像被屏蔽
     
发表于 2009-1-14 21:38 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

发表于 2009-1-14 22:02 | 显示全部楼层
樓主你這是基本概念都沒搞明白

樓上正解,某樓的發言在搞笑

Win下C++首推Dev-C++
回复

使用道具 举报

 楼主| 发表于 2009-1-14 22:05 | 显示全部楼层
楼上的各位..我下了个VC++2005

新建了.cpp的文件...直接复制了19楼的同志的东西..


#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
    int i;
    cin>>i;
    cout<<i/86400<<\" days \"<<i%86400/3600<<\" Hours \"<<i%86400%3600/60<<\" Minutes \"<<i%86400%3600%60<<\" Seconds \"<<endl;
    system(\"PAUSE\");
    return EXIT_SUCCESS;
}

但是他也是读不出来哦..


1>------ Build started: Project: times, Configuration: Debug Win32 ------
1>Compiling...
1>times.cpp
1>c:\\users\\nana\\documents\\visual studio 2005\\projects\\times\\times\\times.cpp(17) : error C2144: syntax error : \'int\' should be preceded by \';\'
1>c:\\users\\nana\\documents\\visual studio 2005\\projects\\times\\times\\times.cpp(30) : error C2065: \'”\' : undeclared identifier
1>c:\\users\\nana\\documents\\visual studio 2005\\projects\\times\\times\\times.cpp(30) : error C2146: syntax error : missing \';\' before identifier \'seconds\'
1>c:\\users\\nana\\documents\\visual studio 2005\\projects\\times\\times\\times.cpp(30) : error C2146: syntax error : missing \';\' before identifier \'correspond\'
1>c:\\users\\nana\\documents\\visual studio 2005\\projects\\times\\times\\times.cpp(30) : warning C4551: function call missing argument list
1>c:\\users\\nana\\documents\\visual studio 2005\\projects\\times\\times\\times.cpp(30) : error C2065: \'correspond\' : undeclared identifier
1>c:\\users\\nana\\documents\\visual studio 2005\\projects\\times\\times\\times.cpp(30) : error C2146: syntax error : missing \';\' before identifier \'to\'
1>c:\\users\\nana\\documents\\visual studio 2005\\projects\\times\\times\\times.cpp(30) : error C2065: \'to\' : undeclared identifier
1>c:\\users\\nana\\documents\\visual studio 2005\\projects\\times\\times\\times.cpp(30) : error C2146: syntax error : missing \';\' before identifier \'”\'
1>c:\\users\\nana\\documents\\visual studio 2005\\projects\\times\\times\\times.cpp(30) : error C2563: mismatch in formal parameter list
1>c:\\users\\nana\\documents\\visual studio 2005\\projects\\times\\times\\times.cpp(30) : error C2568: \'<<\' : unable to resolve function overload
1>        c:\\program files\\microsoft visual studio 8\\vc\\include\\ostream(971): could be \'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)\'
1>        with
1>        [
1>            _Elem=wchar_t,
1>            _Traits=std::char_traits<wchar_t>
1>        ]
1>        c:\\program files\\microsoft visual studio 8\\vc\\include\\ostream(963): or \'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)\'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        c:\\program files\\microsoft visual studio 8\\vc\\include\\ostream(937): or \'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)\'
1>Build log was saved at \"file://c:\\Users\\nana\\Documents\\Visual Studio 2005\\Projects\\times\\times\\Debug\\BuildLog.htm\"
1>times - 10 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

一大堆..看不太懂..
回复

使用道具 举报

 楼主| 发表于 2009-1-14 22:14 | 显示全部楼层
呜呜..41楼的搞出来了..

我通宵把上个星期的所有作业补完..一会好好看书..

郁闷死了..
回复

使用道具 举报

头像被屏蔽
     
发表于 2009-1-14 23:06 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

     
发表于 2009-1-14 23:23 | 显示全部楼层
vc的话,你要先写好代码,然后在工具-〉visual studio xxxx command prompt 里
cl 文件名.cpp

教学是足够了。如果是建立工程写代码恐怕你还接受不了

vc又好用又免费,stl等库又设置好了,没什么理由不去用它
回复

使用道具 举报

     
发表于 2009-1-14 23:36 | 显示全部楼层
原帖由 HyperIris 于 2009-1-14 23:06 发表
我用了这么多年C++都不敢说熟练了

你要是一晚上能学会……


不要打击人家的积极性嘛

c++和小说里的邪派武功类似,学得越多,反噬越大

开始学些语句用些库,还不算什么
学到设计class,就开始会干扰设计思路
学到模板,就要求在设计上要有极强的控制力和计划性

做做家庭作业,学一个星期应该足够了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|上海互联网违法和不良信息举报中心|网上有害信息举报专区|962110 反电信诈骗|举报电话 021-62035905|Stage1st ( 沪ICP备13020230号-1|沪公网安备 31010702007642号 )

GMT+8, 2025-8-7 11:51 , Processed in 0.079927 second(s), 6 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表