Programming for Chemical Engineers Using C, C++, and MATLAB

Appendix C: C/C++ Functions and Statements

Here are some of C/C++ available functions and statements.

C STANDARD INPUT/OUTPUT FUNCTIONS

  • Included in the header file:

  • printf(string) writes formatted output to the screen

  • scanf(string &address) scans and formats input from the stream

  • getchar(void) gets character

  • putchar(char) output character

  • puts(string) output a string to the stream

C Console Input/Output Functions

  • Included in the header file:

  • clreol(void) clears to end of line in text window

  • clrscr(void) clears the text mode window

  • cprintf(string) writes formatted output to the screen

  • cscanf(string) scans and formats input from the console

  • getch(void) gets characters from keyboard but not print to screen

  • getch(void) gets characters from keyboard but not print to screen

  • getche(void) gets characters from keyboard and echoes to screen

  • gotoxy(int x, int y) position cursor in windows

  • kbhit(void) checks for currently available keystrokes

  • wherex(void) gives horizontal position within window

  • wherey(void) gives vertical cursor position within window

C Basic Mathematical Functions

  • Included in the header file:

  • acos(double x) returns the arc cosine value of x

  • asin(double x) returns the arc sine value of x

  • atan(double x) returns the arc tangent value of x

  • cos(double x) returns the cosine value of x

  • exp(double x) returns the value of the natural logarithm e raise to the x

  • fabs(double x) returns the absolute value...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Multi-Screen Display Controllers
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.