欢迎来到毕设资料网! | 帮助中心 毕设资料交流与分享平台
毕设资料网
全部分类
  • 毕业设计>
  • 毕业论文>
  • 外文翻译>
  • 课程设计>
  • 实习报告>
  • 相关资料>
  • ImageVerifierCode 换一换
    首页 毕设资料网 > 资源分类 > DOC文档下载
    分享到微信 分享到微博 分享到QQ空间

    C++毕业论文外文翻译

    • 资源ID:127420       资源大小:90.50KB        全文页数:9页
    • 资源格式: DOC        下载积分:100金币
    快捷下载 游客一键下载
    账号登录下载
    三方登录下载: QQ登录
    下载资源需要100金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。

    C++毕业论文外文翻译

    1、 2012 年毕业设计论文英汉互译部分 Chapter 8. The IO Library In C+, input/output is provided through the library. The library defines a family of types that support IO to and from devices such as files and console windows. Additional types allow strings to act like files, which gives us a way to convert data to an

    2、d from character forms without also doing IO. Each of these IO types defines how to read and write values of the built-in data types. In addition, class designers generally use the library IO facilities to read and write objects of the classes that they define. Class types are usually read and writt

    3、en using the same operators and conventions that the IO library defines for the built-in types. This chapter introduces the fundamentals of the IO library. Later chapters will cover additional capabilities: Chapter 14 will look at how we can write our own input and output operators; Appendix A will

    4、cover ways to control formatting and random access to files. Our programs have already used many IO library facilities: istream (input stream) type, which supports input operations ostream (output stream) type, which provides output operations cin (pronounced see-in) an istream object that reads the

    5、 standard input. cout (pronounced see-out) an ostream object that writes to the standard output cerr (pronounced see-err) an ostream object that writes to the standard error. cerr is usually used for program error messages. operator , which is used to read input from an istream object operator to re

    6、ad data regardless of whether we re reading a console window, a disk file, or an in-memory string. Similarly, we d like to use that operator regardless of whether the characters we read fit in a char or require the wchar_t(Section2.1.1,p.34) type. At first glance, the complexities involved in suppor

    7、ting or using these different kinds of devices and different sized character streams might seem a daunting problem. To manage the complexity, the library uses inheritance to define a set of object-oriented classes. Well have more to say about inheritance and object-oriented programming in Part IV, b

    8、ut generally speaking, types related by inheritance share a common interface. When one class inherits from another, we (usually) can use the same operations on both classes. More specifically, when two types are related by inheritance, we say that one class inherits the behavior the interface of its

    9、 parent. In C+ we speak of the parent as the base class and the inheriting class as a derived class. The IO types are defined in three separate headers: iostream defines the types used to read and write to a console window, fstream defines the types used to read and write named files, and sstream de

    10、fines the types used to read and write in-memory strings. Each of the types in fstream and sstream is derived from a corresponding type defined in the iostream header. Table 8.1 lists the IO classes and Figure 8.1 on the next page illustrates the inheritance relationships among these types. Inherita

    11、nce is usually illustrated similarly to how a family tree is displayed. The topmost circle represents a base (or parent) class. Lines connect a base class to its derived (or children) class(es). So, for example, this figure indicates that istream is the base class of ifstream and istringstream. It i

    12、s also the base class for iostream, which in turn is the base class for sstream and fstream classes. Because the types ifstream and istringstream inherit from istream, we already know a great deal about how to use these types. Each program weve written that read an istream could be used to read a fi

    13、le (using the ifstream type) or a string (using the istringstream type). Similarly, programs that did output could use an ofstream or ostringstream instead of ostream. In addition to the istream and ostream types, the iostream header also defines the iostream type. Although our programs have not use

    14、d this type, we actually know a good bit about how to use an iostream. The iostream type is derived from both istream and ostream. Being derived from both types means that an iostream object shares the interface of both its parent types. That is, we can use an iostream type to do both input and outp

    15、ut to the same stream. The library also defines two types that inherit from iostream. These types can be used to read or write to a file or a string. Using inheritance for the IO types has another important implication: As well see in Chapter 15, when we have a function that takes a reference to a b

    16、ase-class type, we can pass an object of a derived type to that function. This fact means that a function written to operate on istream& can be called with an ifstream or istring stream object. Similarly,a function that takes an ostream& can be called with an ofstream or ostring stream object. Becau

    17、se the IO types are related by inheritance, we can write one function and apply it to all three kinds of streams: console, disk files, or string streams. International Character Support The stream classes described thus far read and write streams composed of type char. The library defines a correspo

    18、nding set of types supporting the wchar_t type. Each class is distinguished from its char counterpart by a w prefix. Thus, the types wostream, wistream, and wiostream read and write wchar_t data to or from a console window. The file input and output classes are wifstream, wofstream, and wfstream. Th

    19、e wchar_t versions of string stream input and output are wistring stream, wostring stream, and wstring stream. The library also defines objects to read and write wide characters from the standard input and standard output. These objects are distinguished from the char counterparts by a w prefix: The

    20、 wchar_t standard input object is named wcin; standard output is wcout; and standard error is wcerr. Each of the IO headers defines both the char and wchar_t classes and standard input/output objects. The stream-based wchar_t classes and objects are defined in iostream, the wide character file strea

    21、m types in fstream, and the wide character string streams in sstream. No Copy or Assign for IO Objects For reasons that will be more apparent when we study classes and inheritance in Parts III and IV, the library types do not allow allow copy or assignment. This requirement has two particularly important implications. As well see in Chapter 9, only element types that support copy can be stored


    注意事项

    本文(C++毕业论文外文翻译)为本站会员(泛舟)主动上传,毕设资料网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请联系网站客服QQ:540560583,我们立即给予删除!




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们
    本站所有资料均属于原创者所有,仅提供参考和学习交流之用,请勿用做其他用途,转载必究!如有侵犯您的权利请联系本站,一经查实我们会立即删除相关内容!
    copyright@ 2008-2025 毕设资料网所有
    联系QQ:540560583