Dana Vrajitoru

C243 Data Structures
Programming Style Requirements

Indentation and Spacing

Naming Conventions

Program Structure

Compilation

Setting the Indentation
Here are some instructions for setting the indentation to 4 spaces and not to use tabs by editor.

Emacs
Edit a file called .emacs (the dot is part of the name) directly in your home directory (create it if it doesn't exist) and add the following lines at the end:

; use spaces instead of tabs
(setq-default indent-tabs-mode nil)
; use 4 spaces in the indentation
(setq default-tab-width 4)
(setq tab-width 4)
(setq c-default-style "linux")
(setq c-basic-offset 4)
(c-set-offset 'comment-intro 0)

Visual Studio 2010
From the Tools menu, click on Options, then the Text Editor tab. Click either the All Languages section, or C/C++.
Check the option Insert Spaces.
Set the Indent Size to 4 and also Tab Size to 4 (to make sure).
This may work similarly with other versions of VS.