首页 | 官方网站   微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 20 毫秒
1.
A style of programming that uses higher-order functions has become common in C++, following the introduction of the Standard Template Library (STL) into the standard library. In addition to their utility as arguments to STL algorithms, function parameters are useful as callbacks on GUI events, defining tasks to be executed in a thread, and so forth. C++’s mechanisms for defining functions or function objects are, however, rather verbose, and they often force the function’s definition to be placed far from its use. As a result, C++ frustrates programmers in taking full advantage of its own standard libraries. The effective use of modern C++ libraries calls for a concise mechanism for defining small one-off functions in the language, a need that can be fulfilled with lambda expressions.This paper describes a design and implementation of language support for lambda expressions in C++. C++’s compilation model, where activation records are maintained in a stack, and the lack of automatic object lifetime management make safe lambda functions and closures challenging: if a closure outlives its scope of definition, references stored in a closure dangle. Our design is careful to balance between conciseness of syntax and explicit annotations to guarantee safety. The presented design is included in the draft specification of the forthcoming major revision of the ISO C++ standard, dubbed C++0x. In rewriting typical C++ programs to take advantage of lambda functions, we observed clear benefits, such as reduced code size and improved clarity.  相似文献   

2.
This paper describes an experiment in the development of a small piece of software in both the languages C and C++ in a university setting. The C++ codes were found to be more modular than the corresponding C codes. Some of the other effects of C++ on program quality are very briefly discussed. The paper also discusses some of the errors that C programmers may make as novice C++ programmers, and the testing of object-oriented programs. Some of the error types possible in C++, but not in C, include delays in the flushing of output buffers and polymorphism.  相似文献   

3.
C++Builder与Matlab、Mideva接口编程及其实现光谱仪改造   总被引:5,自引:0,他引:5  
探讨了 C++Builder与 Matlab、Mideva接口编程的实现方法 ,并给出了利用接口编程对 WDP50 0D型自动扫描单色仪组成的光谱仪进行改造的例子。实践证明这种方法是行之有效的 ,并且对数据分析计算绘图应用软件开发有重要意义。  相似文献   

4.
N. H. Gehani  W. D. Roome 《Software》1988,18(12):1157-1177
C++ and Concurrent C are both upward-compatible supersets of C that provide data abstraction and parallel programming facilities, respectively. Although data abstraction facilities are important for writing concurrent programs, we did not provide data abstraction facilities in Concurrent C because we did not want to duplicate the C++ research effort. Instead, we decided that we would eventually integrate C++ and Concurrent C facilities to produce a language with both data abstraction and parallel programming facilities, namely, Concurrent C++. Data abstraction and parallel programming facilities are orthogonal. Despite this, the merger of Concurrent C and C++ raised several integration issues. In this paper, we will give introductions to C++ and Concurrent C, give two examples illustrating the advantages of using data abstraction facilities in concurrent programs, and discuss issues in integrating C++ and Concurrent C to produce Concurrent C++.  相似文献   

5.
Visual C 是基于C/C 的集成开发工具,它的编辑器、调试器、连接器、文本编辑器和资源编辑器的功能都很强大。文章采用图像处理、图形设计的新方法和新思路,利用Visual C 的开发环境,将图像处理和图形设计结合起来,完成了图形图像编程的任务。  相似文献   

6.
Oracle C Class Library是支持Visual C 编译器的更为灵活、简便、可靠和高效的数据库连接方法。本文分析了0racle C Class Library的工作原理及使用过程,并给出了一个使用实例,说明了该数据访问技术在数据库编程中的具体实现方法。  相似文献   

7.
C语言中的++运算符是一种特殊的运算符,其特殊性在于一个运算符包含两个操作,不同的编译器对这两个操作在复合表达式中的处理机制不同,而同一个编译器对其在程序中的不同位置也有不同的处理。教材中仅仅对++运算符作了最简单的介绍,并没有对++运算的左连接和右连接同时参与运算时的处理规则作介绍,本文对++运算在不同情况下的求解进行了深入研究,得出对++运算符的运算要根据一定的程序环境和编译器环境而定。  相似文献   

8.
一种实现C++ Builder与Matlab混合编程的方法   总被引:1,自引:0,他引:1  
在软件开发中,提出了一种实现C++Builder与Matlab混合编程的方法。此方法在C++Builder环境中直接调用Matlab函数,避免编写大量代码,且可脱离Matlab环境执行程序。本文着重介绍了如何利用Matcom在C++Builder中调用Matlab函数,并举例证明该方法是有效的。  相似文献   

9.
异常机制是C++崭新而高级的特性,比起传统的返回错误代码的做法,异常机制能够针对各种可能的错误提供更有效的解决方法,而且可以使正常代码和错误处理清晰划分开来。关于如何安全、可靠地使用异常机制,MISCRAC++给出了一些相关的规范。  相似文献   

10.
Dale Parson  Zhenyu Zhu 《Software》2000,30(15):1641-1660
The JavaTM Native Interface (JNI) provides a set of mechanisms for implementing Java methods in C or C++. JNI is useful for reusing C and C++ code repositories within Java frameworks. JNI is also useful for real‐time systems, where compiled C/C++ code executes performance‐critical tasks, while Java code executes system control and feature tasks. Available JNI literature concentrates on creating Java proxy classes that allow Java clients to interact with C++ classes. Current JNI literature does not discuss Java proxies for entire C++ inheritance hierarchies; that is the topic of this paper. Our experience in reusing C++ class hierarchies within a Java framework has uncovered a set of useful techniques for constructing Java proxy class hierarchies that mirror their C++ counterparts. This report gives both high level design guidelines and specific programming idioms for constructing Java class hierarchies that serve as proxies for C++ counterparts. We begin by discussing opportunities for reuse within a proxy class hierarchy, as well as problems caused by differences between the Java and C++ approaches to inheritance. The two most significant differences are due to C++ support for invocation of a member function based on the static type of its class, and C++ support for multiple implementation inheritance. Two example C++ class hierarchies provide the basis for a set of sections that present the design guidelines and that codify the programming idioms. This work could serve as the basis for an automatic generator of Java proxy class hierarchies. Copyright © 2000 John Wiley & Sons, Ltd.  相似文献   

11.
本文介绍C++在嵌入式系统中的应用研究,并介绍C++编程语言以及嵌入式系统,分析怎样在嵌入式应用中编写优秀的C++代码,最后简明分析了C++在嵌入式领域的发展前景。  相似文献   

12.
阐述了C++语言与C语言的关系,以及C++编程技术的基础,对C++最为突出的程序设计功能类和对象进行分析,给出了C++语言编程的有关技巧.  相似文献   

13.
PARC++ is a system that supports object-oriented parallel programming in C++. PARC++ provides the user with a set of predefined C++ classes that can easily be used for the construction of parallel C++ programs. With the help of PARC++ objects, the programmer is able to create and start new processes (threads), to synchronize their activities (Blocklock, Monitor) and to manage communication via message passing (Mailbox). PARC++ is written in C++ and currently runs on top of the EMEX operating system on a FORCE machine with 11 processing elements and an EDS (European Declarative System) with 28 processing elements. The paper also contains information about the run-time system model, the implementation and some performance measurements.  相似文献   

14.
Visual C++在数字图像处理中的应用   总被引:1,自引:0,他引:1  
赵兆 《现代计算机》2011,(11):57-58,62
随着信息时代的到来,图像信息已经成为信息社会的基本信息之一。数字图像处理是对图像信息的基本处理方法,它通过一些繁杂的算法对大量的图像的数据进行运算以达到人们满意的图像效果。Visual C++在图像处理的效率显著,因此主要介绍使用Visual C++实现数字图像处理的常用算法,介绍Visual C++在图像处理中的基本方法和应用上的技巧。  相似文献   

15.
Verilog到C翻译器的设计与实现   总被引:1,自引:0,他引:1  
戴笛  张福新 《计算机工程》2006,32(9):267-269,271
介绍了一种将Verilog硬件描述转化到等价C/C++代码的自动翻译器的实现过程,并给出了简化Verilog行为模型的疗法、非阻塞赋值串行化的优化算法和一些访存优化原则。该方法没计的翻译器的生成代码可直接由C/C++编译器汇编成可执行程序后进行仿真。采用龙芯RTL作为系统输入的测试表明,该方法的仿真速度可比一般仿真软件有成倍的增加,并能在系统评估和分析上发挥显著的成效。  相似文献   

16.
在VisualC++中不依赖MATLAB环境调用其函数的方法   总被引:5,自引:1,他引:4  
VisualC 是Windows平台下强大的应用程序开发环境,MATLAB是一个功能强大的数值计算和结果可视化的软件。一种有效的将两者紧密结合起来的方法是,在MATLAB环境下利用MATLAB函数开发某些计算程序,将其编译成不依赖MATLAB环境的C函数,在VisualC 中将此C函数编译成动态连接库,然后在VisualC 环境中开发应用程序界面等功能并加载所开发的动态连接库。  相似文献   

17.
详细讨论了在C Builder中使用COM技术调用Matlab数据的基本原理和方法,并给出一个详细的例子,重点突出了如何在MATLAB中生成COM组件,以及如何在C Builder的集成开发环境中调用该组件.该方法充分发挥了C Builder与MATLAB的优势,为科学研究和工程计算提供了更强的技术支持.  相似文献   

18.
文章主要介绍了Windows环境下开发基于C + +Builder的Modem通信软件来实现远程控制 ,着重介绍了如何利用C + +Builder进行串口编程和Modem的基础通信技术。作为实例 ,还介绍了作者自主开发的一个数控切纸机远程诊断系统。  相似文献   

19.
Jrme Darmont 《Software》2000,30(1):37-60
DESP‐C++ is a C++ discrete‐event random simulation engine that has been designed to be fast, very easy to use and expand, and to be valid. DESP‐C++ is based on the resource view. Its complete architecture is presented in detail, as well as a short ‘user manual’. The validity of DESP‐C++ is demonstrated by the simulation of three significant models. In each case, the simulation results obtained with DESP‐C++ match those obtained with a validated simulation software: QNAP2. The versatility of DESP‐C++ is also illustrated this way, since the modelled systems are very different from each other: a simple production system, the dining philosophers' classical deadlock problem, and a complex object‐oriented database management system. Copyright © 2000 John Wiley & Sons, Ltd.  相似文献   

20.
一种用C++动态扩展C#程序的方法   总被引:1,自引:0,他引:1  
提出一种用非托管C++(以下简称C++)动态扩展C#程序的方法。利用托管C++作为适配器,由C++类继承C#基类,并且获取C#程序提供的服务;将C++类利用托管C++作为适配器,通过C#基类的派生类提供给C#程序动态加载。实例表明该方法能够使C++编写的类继承C#程序中的类,获取C#程序提供的服务;并且使C#程序能够动态创建并调用C++类对象。该方法能够为C++源代码的重用、C++源代码与.NET平台语言的混合编程等提供解决方案。  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司    京ICP备09084417号-23

京公网安备 11010802026262号