> July 2011 ~ Online tutorial

realloc

 realloc<ALLOC.H>    realloc reallocates main memory  Declaration:      void far *farrealloc(void far *oldblock, unsigned long nbytes);  Remarks: realloc adjusts the size of the allocated block to size, copying the contents to a new location if necessary.  Return Value:    On success,...

farrealloc

 farrealloc<ALLOC.H>      farrealloc adjusts allocated block in far heap  Declaration:   void *realloc(void *block, size_t size);  Remarks: farrealloc adjusts the size of the allocated block to nbytes, copying the contents to a new location, if necessary.  Return Value:    On success,...

farcoreleft

 farcoreleft<ALLOC.H>   farcoreleft returns a measure of unused memory in the far heap  Declaration:     All except tiny models:          unsigned long farcoreleft(void);  Remarks: farcoreleft returns a measure of the amount of unused memory in the far heap beyond the highest...

coreleft

 coreleft<ALLOC.H>    coreleft returns a measure of unused memory  Declaration:    Tiny, small, and medium models:  unsigned coreleft(void);   Compact, large, and huge models: unsigned long coreleft(void);  Remarks: coreleft returns a measure of RAM memory not in use. The value coreleft gives...

farmalloc() in c

 farmalloc()  Allocates from far heap  Declaration:  void far *farmalloc(unsigned long nbytes);  Remarks: farmalloc allocates a block of memory nbytes bytes long from the far heap.  Return Value:   On success, farmalloc returns a pointer     to the newly allocated block    On failure...

clearerr

clearerr<STDIO.H>  Resets error indication  Declaration:   void clearerr(FILE *stream);  Remarks: clearerr resets the named stream's error and end-of-file indicators to 0. Once the error indicator is set, stream operations continue to return error status until a call is made to clearerr or rewind. The end-of-file...

fdopen

  fdopen <STDIO.H>    fdopen associates a stream with a file handle  Declaration:    FILE *fdopen(int handle, char *type);       #include <stdio.h>       #include <share.h>       FILE *_fsopen(const char *filename, const char *mode, int shflg);  Remarks:  fdopen...

fflush

fflush                           <STDIO.H>  Flushes a stream  Declaration: int fflush(FILE *stream);  Remarks: If the given stream has buffered output, fflush writes the output for stream to the associated file. The stream remains open after fflush has executed....

clearerr

clearerr                    <STDIO.H>  Resets error indication  Declaration: void clearerr(FILE *stream);  Remarks: clearerr resets the named stream's error and end-of-file indicators to 0. Once the error indicator is set, stream operations continue to return error status...

ferror

ferror  <STDIO.H>  Macro that tests if an error has occurred on a stream  Declaration: int ferror(FILE *stream);  Remarks: ferror is a macro that tests the given stream for a read or write error. If the stream's error indicator has been set, it remains set until clearerr or rewind is called, or until the stream...

rewind

rewind                          <STDIO.H>  Repositions file pointer to stream's beginning  Declaration:   void rewind(FILE *stream);  Remarks: rewind(stream) is equivalent to   fseek(stream, 0L, SEEK_SET) except that rewind clears the end-of-file...

putchar

 putchar           <STDIO.H>   putchar is a macro that outputs a character on stdout  Declaration:    int putchar(int c);  Remarks: putchar is a macro defined as putc(c, stdout) putchar puts the character given by c on the output stream stdout.  Return Value: putchar...

getchar

getchar  <STDIO.H>    getchar is a macro that gets a character from stdin    Declaration:    int getchar(void);    Remarks: getchar is a macro defined as getc(stdin) getchar returns the next character on the input stream stdin.  Return Value:  On success,      getchar...

feof

feof                     <STDIO.H>  Macro that tests if end-of-file has been reached on a stream.  Declaration:  int feof(FILE *stream);  Remarks: feof is a macro that tests the given stream for an end-of-file indicator. Once the indicator is set, read operations on...

putw

 putw            <STDIO.H>   putw outputs an integer on a stream  Declaration:    int putw(int w, FILE *stream);  Remarks:  putw outputs the integer w to the given stream. It does not expect (and does not cause) special alignment in the file.  Return Value:  ...

getw

 getw                    <STDIO.H>  getw gets an integer from stream  Declaration:    int getw(FILE *stream);  Remarks:  getw returns the next integer in the named input stream. It assumes no special alignment in the file. getw should not be used when...

fseek

fseek          <STDIO.H>  Repositions the file pointer of a stream  Declaration:   int fseek(FILE *stream, long offset, int whence);  Remarks: fseek sets the file pointer associated with a stream to a new position. fseek discards any character pushed back using ungetc. fseek is used...

brk

Brk Changes data-segment space allocation  Declaration:    int brk(void *addr);  Remarks: brk dynamically changes the amount of space allocated to the calling program's heap by resetting the program's break value to addr. brk and sbrk will fail without making any change in the allocated space if such a change would allocate...

sbrk

 sbrk                  <ALLOC.H>       Changes data-segment space allocation Declaration:    void *sbrk(int incr); Remarks: sbrk changes the allocated space by adding incr bytes to the break value. The amount...

mcalloc

 malloc                <ALLOC.H>  Allocates memory  Declaration:  void *malloc(size_t size);  Remarks: malloc allocates a block of size bytes from the memory heap. It allows a program to allocate memory explicitly as it's needed,...

calloc

 calloc                < ALLOC.H)  Allocates main memory  Declaration:  void *calloc(size_t nitems, size_t size);  Remarks: calloc provides access to the C memory heap, which is available for dynamic allocation of variable-sized blocks...

ifndef in c example

#ifndef, Conditional compilation directives Syntax: #if #else #endif #if #elif #endif 1.The compiler only compiles the lines that follow the #if directive when evaluates to non-zero. 2.Otherwise, the compiler skips the lines that follow until it encounters the matching #else or #endif. 3.If the expression evaluates to false and there is a matching...

ifdef in c

#ifdef, Conditional compilation directives Syntax: #if #else #endif #if #elif #endif 1)The compiler only compiles the lines that follow the #if directive when evaluates to non-zero. 2)Otherwise, the compiler skips the lines that follow until it encounters the matching #else or #endif. 3)If the expression evaluates to...

if directives

#if directive  Conditional compilation directives Syntax: #if #else #endif 1)The compiler only compiles the lines that follow the #if directive when evaluates to non-zero. 2)Otherwise, the compiler skips the lines that follow until it encounters the matching #else or #endif. 3)If the expression evaluates to false and there is a matching...

#include

  #include (directive) Treats text in the file specified by filename as if it appeared in the current file.  Syntax:    #include "filename"    #include <filename>  #include "filename" searches the source path first, then the include path.  #include <filename> does not search the source directory.  Examples:  ...

#line

Normal 0 false false false EN-US X-NONE X-NONE ...

#error in c

#error (directive) Issues error message Syntax: #error If this line of code is compiled by the compiler, a fatal error message will be issued for this line and include the text defined by . Example: #if !defined(MODEL) #error Building model not defined #endif...

#define

  #define (directive)   Defines a macro  Syntax:    #define <id1>[ ( <id2>, ... ) ] <token string> The #define directive defines a macro. Macros provide a mechanism for token replacement with or without a set of formal, function-line parameters. All subsequent...

Switch Programs

Switch Programs #include <stdio.h> #define CODE 0 main () { short digit; printf ("Enter any digit in the range 0..9"); scanf ("%h",&digit); if ((digit < 0) || (digit > 9)) { printf ("Number was not in range 0..9"); return (CODE); } printf ("The Morse code of that digit is "); Morse (digit); } /************************************************/ Morse...

sqrt

sqrt sqrt, sqrtl  Calculates square root  Declaration: Real:     double sqrt(double x);               long double sqrtl(long double @E(x)); Complex:  complex sqrt(complex x);  Remarks: sqrt calculates the positive square root...

scanf

scanf function     cscanf   CONIO.H  The console   fscanf   STDIO.H  A stream   scanf    STDIO.H  stdin   sscanf   STDIO.H  A string   vfscanf  STDIO.H  A stream, using an argument list   vscanf   STDIO.H  stdin, using...

pow()

    Pow() Power function, x to the y (x**y)  Declaration: Real:                    double pow(double x, double y);               long double pow(long double (x), long double...

 <MATH.H>  log and logl     = natural logarithm function log10 and log10l = common logarithm function  Declaration:    Real:     double log(double x);               double log10(double x);              ...

atan() in c

atan Arc cosine, arc sine, and arc tangent functions Declaration: Real: double atan(double x); double atan2(double y, double x); Remarks: atan and atanl calculate the arc tangent of the input value atan2 and atan2l also calculate the arc tangent of the input value Return Value: atan and atanl return the arc tangent of the input...

asin  Arc cosine, arc sine, and arc tangent functions  Declaration:  Real:                                  double atan(double x);              ...

asin  Arc cosine, arc sine, and arc tangent functions  Declaration:  Real:                                                double asin(double x);              ...

 acos  Arc cosine, arc sine, and arc tangent functions  Declaration:  Real:                double acos(double x); long double acosl(long double (x)); complex acos(complex z); Remarks:                ...

 struct (keyword) Groups variables into a single record Syntax:   struct [<struct type name>] {    [<type> <variable-name[, variable-name, ...]>] ;    [<type> <variable-name[, variable-name, ...]>] ;    ...  } [<structure variables>] ;A struct,...