Skip to content
Hub Nexus

No author yetClaim it

Version 1Updated 2 min read

Support

Assembler

See Embedded Systems/Mixed C and Assembly Programming

Cg

Make the main program (for CPU) in C, which loads and run the Cg program ( for GPU ).[1][2][3]

Header files

Add to C program:[4]

#include /* To include the core Cg runtime API into your program */
#include /* to include the OpenGL-specific Cg runtime API */

Minimal program

  • by bobobobo[5]

Java

Using the Java native interface (JNI), Java applications can call C libraries.

See also

Perl

To mix Perl and C, we can use XS. XS is an interface description file format used to create an extension interface between Perl and C code (or a C library) which one wishes to use with Perl.

The basic procedure is very simple. We can create the necessary subdirectory structure by running "h2xs" application (e.g. "h2xs -A -n Modulename"). This will create - among others - a Makefile.PL, a .pm Perl module and a .xs XSUB file in the subdirectory tree. We can edit the .xs file by adding our code to that, let's say:

void
hello()
CODE:
printf("Hello, world!\n");

and we can successfully use our new command at Perl side, after running a "perl Makefile.PL" and "make".

Further details can be found on the perlxstut perldoc page.

Python

Here can be found some details about extending Python with modules written in C. You might read about Cython and Pyrex as well, that makes easier to create modules in C, translating a Python-like code into C.

Using the Python ctypes module, one can write C code directly into Python.

Further reading

References

by Fusion Industries]

Where this page came from

This page was imported from Wikibooks. From “C programming” on Wikibooks, by its contributors, under CC BY-SA 4.0. Changed here: set as a page; navigation and edit links left out; each image under its own licence, credited in its caption.

Nobody has written it yet — it is the source material at a new address, which is why search engines are asked to skip it and why no one earns from it. It is up for grabs: take it on, and it is yours to rewrite and to earn from.

Get each new page of

C programming

Following means one email when a page is added, nothing when a page changes.

Following means one email when a page is added, nothing when a page changes.

Comments

Spinner Logo

Next in C programming

CC BY-SA 4.0
Since the C Programming-Language was not created with Object Oriented Programming in mind, it has no explicit support for classes, inheritance, polymorphism and other OO Concepts. Neither does it have its own Virtual Table, which is found in object-oriented languages such [C++]( [Java]( and [C#]( Th
CC BY-SA 4.0
A **statement** is a command given to the computer that instructs the computer to take a specific action, such as display to the screen, or collect input. A computer program is made up of a series of statements. In C, a statement can be any of the following: ## Labeled statements A statement can be
CC BY-SA 4.0
GCC, Clang) to emit a diagnostic message: #define EMIT_MESSAGE(str) EMIT_PRAGMA(message(str)) #define EMIT_PRAGMA(content) _Pragma(#content) EMIT_MESSAGE("Hello, world!") Some compilers use a slight variant syntax; in particular, MSVC supports **__pragma** instead of **_Pragma**. Specific compilers
CC BY-SA 4.0
The **C POSIX library** is a language-independent library (using C calling conventions) that adds functions specific to POSIX systems. POSIX (and the Single Unix Specification) specifies a number of routines that should be available over and above those in the C standard library proper. It was devel
CC BY-SA 4.0
C was designed in English and assumes the common [ASCII]( character set made for English, which includes such characters as {, }, [, ], and so on. Some other character sets (like [EBCDIC]( on mainframes), however, do not have these or other characters which are required by C. Since even the simplest
CC BY-SA 4.0
This is a basic introduction to good coding style in the C Programming Language. It is designed to provide information on how to effectively use indentation, comments, and other elements that will make your C code more readable. It is not a tutorial on actual C programming. As a beginning programmer