Visual C
return to main page
This page will be updated from time to time with commands exampls.
You are invited to visit and use it.
LIBRARYS
========
#include < stdio.h >
#include < stdlib.h >
#include < conio.h >
#include < graph.h >
#include < math.h >
#include < string.h >
#include < malloc.h >
#include < dos.h >
#include < time.h >
DEFINITIONS
===========
int x,y,z; define x y z as integers -32768 to +32767
char ch; efine ch as char (all ascii chars)
float f; define f as a float (real) (0.00,3.48...)
unsigned xxx defind an unsighne (xxx is for int, char, float...[unsigned int x;])
int *ptr; define ptr to be a pointer of int type(2 byte)
char *pntr; define pntr to be a pointer if char type (1 byte)
int **ptp; define pointer to pointer
struct STRCT defining struct which have 3 components
{ it's size is: int + int + char + arr size
int x,y; 2 2 1 10 = 15
char ch, arr[10];
}stt; defining stt as STRCT type
struct STRCT my_strct; defining my_strct as STRCT type
COMMANDS
========
for (i=0;i<=10;i++) counts from 0 to 10
if (i<=10) checks if i<=10 will do the followed order
while (i<10) will check and do while i<10 till i will be >=10
do
,(statments), ;
while (i<=10) will do once and check if correct will continue
switch (i)
case x: ,,, ;break; multiple choices
case y: ,,, ;return;
defalt : ,,, ; if non of the cases was found will do the defalt
ch=getch(); get a char from keyboard
putch(ch); types the char (can put ascci value too)
printf("xxx"); prints xxx
printf("%c %d %e",i,i,i); &c give char %d give decimal value %e - exponent
%s, %x, %u, %o, %f s-string, x-hexadecimal, u-unsigned, o-octal, f-float
%ld, %lf ld= long decimal(int), lf=long float
scanf ("%c",&i); put ch into i (same values as printf)
char arr[10]; to define an array of chars sized 10 cells
int arr[ ]=[1,2,3,4,5,6,7,8];put values into the array
int [10][20]; 10X20 array (mattrix)
_settextposiiton(y,x); set the position of text in y,x cordinate
_settextcolor(x); set the text color (x= 0 to 7 )
_outtext("Hello"); put on screen the text in " "
PROGRAM DESIGHN
===============
#include &tl >
global wariable definitions (int,char...)
main()
{
local variable (int char...)
-----------
---------
--------
}
Email: omris@angelfire.com