background preloader

C/c++

Facebook Twitter

Objective-C. Objective-C source code program files usually have .m filename extensions, while Objective-C header files have .h extensions, the same as for C header files.

Objective-C

History[edit] Objective-C was created primarily by Brad Cox and Tom Love in the early 1980s at their company Stepstone.[2] Both had been introduced to Smalltalk while at ITT Corporation's Programming Technology Center in 1981. The earliest work on Objective-C traces back to around that time.[3] Cox was intrigued by problems of true reusability in software design and programming. He realized that a language like Smalltalk would be invaluable in building development environments for system developers at ITT. However, he and Tom Love also recognized that backward compatibility with C was critically important in ITT's telecom engineering milieu.[4] Cox began writing a pre-processor for C to add some of the capabilities of Smalltalk. Popularization through NeXT[edit] Syntax[edit] The Function Pointer Tutorials - Index. C++ Language Tutorial. This website uses cookies.

C++ Language Tutorial

By continuing, you give permission to deploy cookies, as detailed in our privacy policy. ok Search: Not logged in C++ Language These tutorials explain the C++ language from its basics up to the newest features introduced by C++11. Introduction Compilers Basics of C++ Program structure Compound data types Classes Other language features C++ Standard Library Input/Output with files Tutorials.

CPPF77. Contents 2.

CPPF77

FORTRAN FEATURES SUPPORTED2.1 SUBROUTINE AND FUNCTION CALLS2.1.1 Single value parameters2.1.2 Array parameters2.2 UNSUPPORTED OR UNTESTED FEATURES 3. IMPLEMENTING A FORTRAN INTERFACE IN C++3.1 LINKAGE CONVENTIONS3.2 CALLING CONVENTIONS3.3 PROTOTYPING A SUBROUTINE IN C++3.4 PROTOTYPING A FUNCTION IN C++3.5 PASSING PARAMETERS FROM C++ TO F77 AND BACK3.5.1 Passing single-value parameters3.5.2 Passing single-dimension array parameters3.5.3 Passing multi-dimension array parameters3.5.4 Passing single-value COMPLEX parameters3.5.4.1 FORTRAN functions returning COMPLEX values3.5.5 Passing single-value CHARACTER parameters3.5.5.1 Solution strategy3.5.5.2 single CHARACTER string example3.5.5.3 Passing single-dimension CHARACTER array parameters3.6 LINKING C++ AND FORTRAN.

Tutorial: Using C/C++ and Fortran together. Order of multi dimensional arrays in C/C++ is the opposite of FORTRAN.

Tutorial: Using C/C++ and Fortran together

Native FORTRAN layout (collumn-major order): INTEGER A(2,3) Or INTEGER A(2,2,2) Native C layout (row-major order) is NOT equivalent to the FORTRAN layout: int a[2][3]; Thus: Equivalent multidimension arrays: FORTRAN 77: INTEGER I(2,3,4) FORTRAN 90: INTEGER, DIMENSION(2,3,4) :: I C: int i[4][3][2]; Accessing a FORTRAN array in C: Native FORTRAN: Native C: C array a[3][2] memory layout: In FORTRAN 90, also check out the "RESHAPE" directive. Fortran subroutines are the equivalent of "C" functions returning "(void)". Note: The entry point names for some FORTRAN compilers have an underscore appended to the name. The f77 comiler flags "-fno-underscore" and "-fno-second-underscore" will alter the default naming in the object code and thus affect linking.

Note: The case in FORTRAN is NOT preserved and is represented in lower case in the object file. Man pages: Character variables: C++ Operator Overloading Guidelines. One of the nice features of C++ is that you can give special meanings to operators, when they are used with user-defined classes.

C++ Operator Overloading Guidelines

This is called operator overloading. You can implement C++ operator overloads by providing special member-functions on your classes that follow a particular naming convention. For example, to overload the + operator for your class, you would provide a member-function named operator+ on your class. The following set of operators is commonly overloaded for user-defined classes: = (assignment operator) + - * (binary arithmetic operators) += -= *= (compound assignment operators) == !

Here are some guidelines for implementing these operators.