What machine and compiler should I use?
Your program will be evaluated only on machines in MSEE190. And gcc will be used for compilation and linking. It is recommended that you check your program with them before homework submission.
For working on MSEE190 machines, students can either directly logon on them or can connect to them through SSH (SecureCRT etc).
For directly logging in: Type your Purdue login id and password (on one of MSEE190 machines)
How can I connect to the machines in MSEE190 using SecureCrt?
Please check the ITaP help page http://help.itap.purdue.edu/viewarticle.php?articleid=1534&refid=7 to see the steps for using secureCrt. Though it describes the procedure for changing permission on your website, the general technique for using secureCrt is the same. Follow steps 1 – 4 given in the specified link to get started. Check what should be the hostname in your case from FAQ 1.
Where can I download the SSH client?
go to https://www.purdue.edu/securepurdue/download/ , and download and install Secure CRT
How can I make executible file from my source code?
In a path where the source is located, enter
gcc [C source]
This will produce a.out executible file. To run, enter
./a.out
For more options for compilation and linking, refer to gcc man page by excecuting
man gcc
Do I need to leave comments in the source code of homework?
You should comment in your code in a way that who knows C programming can understand it without much effort. If the source is too complex to understand but you don't leave any adequate comments in it, you may receive a penalty on your homework grade. However, it does not mean you have to comment line by line. You don't need to leave comments on a statement or a routine that tells what it does by itself. Following is an example.
strcpy(temp, str1); // copy str1 to temp
strcpy(str1, str2); // copy str2 to str1
strcpy(str2, temp); // copy temp to str2
// swap str1 and str2
strcpy(temp, str1);
strcpy(str1, str2);
strcpy(str2, temp);
After you run "gcc" to compile your source file, you'll get the default executable file "a.out". To run your program, do not just type "a.out" and enter directly. Use "./a.out" instead. (The prefix "./" indicates the path of current directory if you and your program are at the same directory)You need to add a path to your program before the executable file name to run a linux program in the shell.
Standard input (std) is data (often text a user types)going into a program. A program under Linux can read these data just like reading from a file. A virtual file stream (FILE * stdin) is created and opened automatically before a program begins to run. So programmers can use fscanf(stdin, "some_format", ...) to get what a user types into the program.
You can debug your program in a GCC environment using the GNU Debugger popularly known as GDB. Using GDB you can find out the exact line in your program that causes segmentation fault or other errors. The follwing steps briefly describe how to use GDB.
For more questions, please email at ![]()