返回   cpper编程论坛 > Zion/测试
注册账号 论坛帮助 会员列表 日历事件 搜索 今日新帖 标记版面已读

Zion/测试 惹人烦的东西这边来

回复
 
LinkBack 主题工具 显示模式
  #1 (permalink)  
旧 2005-05-11
up2009 的头像
普通会员
 
注册日期: 2005-05-11
帖子: 37
up2009 正向着好的方向发展
默认 刚学的,问问为什么?

//test3.cpp
#include <iostream.h>
//声明 i 是全程外部变量
int i;
//下面为函数原型
void function_1(void);
void function_2(void);
main()
{
cout<<"i inside main() is"<<i<<"\n";
function_1();
}

void function_1(void)
{
i=i+1;
cout<<"i inside function_1() is"<<i<<"\n";
function_2();
}
void function_2(void);
{
i=i+1;
cout<<"i inside function_2() is"<<i<<"\n";
}
按照书打的
提示错误,说得在12行应该是个Value
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #2 (permalink)  
旧 2005-05-11
bankrock 的头像
高级会员
 
注册日期: 2003-12-11
帖子: 847
文章: 7
bankrock 正向着好的方向发展
默认

这个程序还真是够不雅的,集各家之所短

楼主还是把这本书扔了罢,推荐<<Accelerate C++>>或<<Essential C++>>。碰到问题先自己想想,一味问别人是没有收获的。
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #3 (permalink)  
旧 2005-05-11
up2009 的头像
普通会员
 
注册日期: 2005-05-11
帖子: 37
up2009 正向着好的方向发展
默认

晕啊,
多谢二楼的朋友,网上搜了一下,发现很多人都在找这本书;
下面是下载地址,可用,我正在下:
http://www.9soho.com/Software/Catalog13/475.html
希望能方便找这本书的朋友。
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #4 (permalink)  
旧 2005-05-11
up2009 的头像
普通会员
 
注册日期: 2005-05-11
帖子: 37
up2009 正向着好的方向发展
默认

能不能解说一下,有哪些错误
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #5 (permalink)  
旧 2005-05-11
up2009 的头像
普通会员
 
注册日期: 2005-05-11
帖子: 37
up2009 正向着好的方向发展
默认

能不能解说一下,有哪些错误
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #6 (permalink)  
旧 2005-05-11
bankrock 的头像
高级会员
 
注册日期: 2003-12-11
帖子: 847
文章: 7
bankrock 正向着好的方向发展
默认

代码:
#include <iostream.h>
已经抛弃了的头文件,应写成这样:
代码:
#include <iostream> //using namespace std; //要直接使用cout就要加上这一句
主函数格式应为:
代码:
int main() { }
还有就是
代码:
void function_1(void) void function_2(void)
void参数没必要加,不过从这里可以看出作者大概是C中毒太深。
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #7 (permalink)  
旧 2005-05-12
wqqafnd 的头像
高级会员
 
注册日期: 2004-10-08
帖子: 196
文章: 1
wqqafnd 正向着好的方向发展
发送 MSN 消息给 wqqafnd
默认

没错误啊,我用.NET运行成功了。
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #8 (permalink)  
旧 2005-05-12
wqqafnd 的头像
高级会员
 
注册日期: 2004-10-08
帖子: 196
文章: 1
wqqafnd 正向着好的方向发展
发送 MSN 消息给 wqqafnd
默认

当然,除了
引用:
void function_2(void);
{
i=i+1;
cout<<"i inside function_2() is"<<i<<"\n";
}
和一些警告。
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #9 (permalink)  
旧 2005-05-12
up2009 的头像
普通会员
 
注册日期: 2005-05-11
帖子: 37
up2009 正向着好的方向发展
默认

引用:
作者: wqqafnd
没错误啊,我用.NET运行成功了。
我在TC++下就错,我也不知道为啥.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #10 (permalink)  
旧 2005-05-12
bankrock 的头像
高级会员
 
注册日期: 2003-12-11
帖子: 847
文章: 7
bankrock 正向着好的方向发展
默认

所以我想,国内C++教育观念好像还停滞在十几年前。我以前也有写void main,#include<iostream.h>的时候,幸而花了血本买了C++PRIMER,否则也要沉沦了。
初学C++两点建议:
1。用新的编译器,学习用推荐devc++,不要再用古代工具了。TC++我记得连模板都不支持。
2。看国外权威作者的书,国内作者的书一概不要买。具体看那些google一下就可以了。
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #11 (permalink)  
旧 2005-05-12
up2009 的头像
普通会员
 
注册日期: 2005-05-11
帖子: 37
up2009 正向着好的方向发展
默认

哦,我用的是tc3.1中文版,本人E文不行,国外原著可看不懂,大哥能否介绍一下该如何下手
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #12 (permalink)  
旧 2005-05-12
polyrandom 的头像
超级版主
 
注册日期: 2002-09-03
帖子: 3,138
文章: 20
polyrandom 正向着好的方向发展
默认

引用:
作者: up2009
哦,我用的是tc3.1中文版,本人E文不行,国外原著可看不懂,大哥能否介绍一下该如何下手
先学英文
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #13 (permalink)  
旧 2005-05-12
cat cat 当前离线
高级会员
 
注册日期: 2003-11-06
帖子: 1,563
文章: 6
cat 正向着好的方向发展
默认

英语不好也不能看国内的那些古董教材,有翻译作品。不过英语还是很重要。
TC 3.1从现在的C++标准看都算不上是一个C++编译器了. 顶多C+吧
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #14 (permalink)  
旧 2005-05-13
高级会员
 
注册日期: 2002-10-12
住址: 上海
帖子: 155
newsuppy 正向着好的方向发展
发送 MSN 消息给 newsuppy
默认

关键是你一本都没看过,只要看过哪怕一本,你就不想再看国内那些书了
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #15 (permalink)  
旧 2005-05-13
bankrock 的头像
高级会员
 
注册日期: 2003-12-11
帖子: 847
文章: 7
bankrock 正向着好的方向发展
默认

像Accelerate,Essential,Primer,TCPL,Eeffective C++, More Effective C++,Inside the C++ Object Model等等很多经典著作都是有中译本的。再加上国内到处都是的电子版和google,想不花钱学也很容易,不过就是伤眼睛。
PS:E文是很重要的,可惜等我发现时已经后悔了。
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #16 (permalink)  
旧 2005-05-13
wqqafnd 的头像
高级会员
 
注册日期: 2004-10-08
帖子: 196
文章: 1
wqqafnd 正向着好的方向发展
发送 MSN 消息给 wqqafnd
默认

我习惯把电子书打印出来,大不了4页书打在一页纸上,也比看银屏舒服些,况且并不是每次打印都要花银子。
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #17 (permalink)  
旧 2005-05-13
up2009 的头像
普通会员
 
注册日期: 2005-05-11
帖子: 37
up2009 正向着好的方向发展
默认

感谢大家热心帮忙!
1、我找到了《Essential C++》中文的,PDF格式,不过打印后不怎么清楚,看着也累;大家有清楚的吗?
2、下载了VC6.0中文版,这个能跟的上了吧?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #18 (permalink)  
旧 2005-05-13
up2009 的头像
普通会员
 
注册日期: 2005-05-11
帖子: 37
up2009 正向着好的方向发展
默认

VC6.0中文版:
http://soft.ddvip.net/SoftView/SoftView_4262.html
Essential C++》中文版:
http://www.sooyle.com/ebook/downfiles/142.htm
化了我半天时间找到的,后来的朋友用的着就去下吧
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #19 (permalink)  
旧 2005-05-13
高级会员
 
注册日期: 2004-12-06
帖子: 142
哑巴英语 正向着好的方向发展
默认

引用:
作者: wqqafnd
我习惯把电子书打印出来,大不了4页书打在一页纸上,也比看银屏舒服些,况且并不是每次打印都要花银子。
:P
难怪问chm怎么分页。。。。。。。。。
只学c++语言,用.net或者g++比较好,别用vc6
msdn其实也是很好的教材
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
  #20 (permalink)  
旧 2005-05-13
up2009 的头像
普通会员
 
注册日期: 2005-05-11
帖子: 37
up2009 正向着好的方向发展
默认

只学c++语言,用.net或者g++比较好,
不懂,全称的学名叫什么?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
回复时引用此帖
回复

书签
主题工具
显示模式

发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码
Trackbacks are 启用
Pingbacks are 启用
Refbacks are 启用



所有时间均为格林尼治时间 +9。现在的时间是 06:48 AM


Powered by vBulletin® 版本 3.7.0
版权所有 ©2000 - 2009,Jelsoft Enterprises Ltd.
(C) Copy Right All Right Reserved 2001 - 2007

Search Engine Friendly URLs by vBSEO 3.1.0