Anda di halaman 1dari 2

CSE101: Dev-Cpp Installation, and C Coding Guide

Author: S. Balaraman

I. Dev-Cpp Installation

Laptop:
0. Copy Dev-Cpp.exe to a folder.

1. Run setup program. It would take ~3 minutes.


- Keep the default directory for installation: C:\Dev-Cpp.
- If you install in a different directory, it's recommended that you do not have the
trapped spaces in the name of the directory.

2. Choose 'English' and other familiar choices. Installation starts.

3. When installation is finished, set the Default User Directory.


- Start Dev-Cpp.
- Tools | Environment Options. Go to 'Files & Directories' tab. Change 'User's
Default Directory' to your own path, where your programs could be saved and
maintained. Eg: "D:\CCPP".

4. Post-installation
- Line numbers: Tools | Editor Options Æ Display tab. Check ‘Line Numbers’ box
- Matching braces: Tools | Editor Options Æ General tab Æ ‘Caret’ section Æ Check
‘Highlight matching braces/parentheses. And, you are ready to go.

LAN:
0. Copy Dev-Cpp.exe to a folder on one of the computers (or a file server) on the LAN.
Share that folder, setting required permissions to allow all users to read the
contents of the folder.

1. Run setup program in one computer in the LAN. It would take ~3 minutes.
- Keep the default directory for installation: C:\Dev-Cpp
- If you install in a different directory, it's recommended that you do not have
trapped spaces in the name of the directory - like 'Dev Cpp'. So, you may just go
with the default directory.

2. Choose 'English' and other familiar choices. Installation starts.

3. When installation is finished, set the Default User Directory.


- Start Dev-Cpp.
- Tools | Environment Options. Go to 'Files & Directories' tab. Change 'User's
Default Directory' to your own path, where your programs could be saved and
maintained. Eg: "Z:\CCPP" (full or relative path depending on the LAN environ).

4. Post-installation
- Line numbers: Tools | Editor Options Æ Display tab. Check ‘Line Numbers’ box
- Matching braces: Tools | Editor Options Æ General tab Æ ‘Caret’ section Æ Check
‘Highlight matching braces/parentheses

5. Do setup in the remaining computers in the LAN.


- Download the setup file from the file server.
- Run setup.
- Copy %Dev-Cpp%\devcpp.ini from that one (first) computer to all other computers.
Your Lab is ready.
CSE101: Dev-Cpp Installation, and C Coding Guide
Author: S. Balaraman

II. CSE101 Practical Coverage and C Coding with Dev-Cpp

1. Start and End of the code:


conio.h does not have all the functions the TC has. You can still code it for using
getch() function. But with gcc, this is the practice: not using conio.h – getch() pair;
instead using the system(“pause”); as the last statement just before the close brace.
This holds the output console (what getch() would do at TC) until a key is pressed. Do
not definitely use clrscr() here.

Write always int main() (a better way is int main(void))rather than main() or void
main(), because they are not good practices.

2. The compiler is 32-bit, so the int size is 4 bytes.


3. I/O: stdin, stdout, stderr, printf(), scanf(), puts(), gets(), getc(), putc(), getchar(),
putchar()
4. Input and Output Format Controls: %-Flag-Minimum Width-Precision-Size-
Code
5. conio.h has: getch(), getche(), kbhit(), putch(), ungetch(). conio.h does not have
gettext(), puttext(), import(), gettextinfo(), gotoxy(), clrscr()

6. Data types: int (short, int, long), float, double, long double; qualifiers: signed,
unsigned
7. Use of sizeof, limits.h, float.h (INT_MIN, INT_MAX, FLT_MAX, …) to know how
many bytes in memory and what limits of values are supported in the machine with
the used compiler
8. Operators: All and their precedence (Precedence Chart and ASCII Chart are available
at ftp)
9. Control constructs: Branching (exit(0), return, abort(), goto, continue, break);
Decision-making (if, if-else, else-if, switch-case-break); Looping (while, do-while, for)
10. Arrays: 1-D, 2-D, 3D (for strings), Sorting and Searching (Max, Min, or any specific),
Matrix, Order reversal, Histogramming, String and character array

11. String-handling functions: strlen(), strcmp(), strcat(), strcpy(), strncmp(), strncat(),


strncpy(), strrev(), strlwr(), and strupr()
12. Funtions: prototyping, defining, and using - factorial, parameter passing (primitive
data types, arrays), Fibonacci Series. Students must be aware that factorial of large
numbers might not be computed. Functions for reading and writing arrays (matrices)
might be coded
13. Structures and Unions: Simple, Nested and Array of Structures; Unions – Declaration
and Usage, Memory requirements
14. And programs based on these applications: Swapping, Summation of set of values,
Counting, Factorial, Fibonacci sequence, Digits reversal, Number system -
conversion, ASCII table, Standard functions.

Anda mungkin juga menyukai