Instructor Diego RiveraGutierrez djrgciseufledu httpciseufledudjrg httpsufcprog2015wordpresscom Lets Backtrack a bit Did you guys register for a CISE account ID: 812259
Download The PPT/PDF document "COP 3275 Computer Programming Using C" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
COP 3275 Computer Programming Using C
Instructor: Diego Rivera-Gutierrez
djrg@cise.ufl.edu
http://cise.ufl.edu/~djrg/
https://ufcprog2015.wordpress.com
/
Let’s Backtrack a bit!
Did you guys register for a CISE account?
If not, do so soon!
http://register.cise.ufl.edu/
Why do we need an account?
All homework projects are expected to work on the CISE Linux machines!
So, if your program doesn’t run, “But it works on my laptop/computer” will not be an acceptable excuse!
Slide3Setting up your Programming environment
Slide4So how do I access a computer to test my project?
Multiple ways! (Once you have registered for an account)
You can always go to one of the CISE computer labs and login to your account there
:
https://
www.cise.ufl.edu/help/access
You can do remote access to one of the servers.
Slide5Quick Poll
Slide6Connecting to a remote Terminal
Windows
Putty
is your best option
Mac OS
From a terminal you can always do SSH. To do so:
Open a Terminal
Type:
ssh
<
yourusername
>@thunder.cise.ufl.edu
For example:
djrg@thunder.cise.ufl.edu
Uploading files to my account
Windows
WinSCP
is your best option
Mac OS
Any SFTP client will do
Options:
Cyberduck
FileZilla
Slide8I’m in a remote Terminal… now what?
So you should see something to the effect of:
The first word (thunder/storm) tells you which server
thunder.cise.ufl.edu and storm.cise.ufl.edu are both available to you
The number (22/25) is a “command number” and is pretty irrelevant
What should I do next?
thunder:22%
storm:25%
Slide9Relevant commands
A list of
useful commands is here:
http://
www.computerhope.com/unix.htm
Command
Function
man
<command>
Provide manual for
the command <command>
cd <directory>
Change current directory/folder to
<directory>
ls
List contents of current directory
pwd
Print working directory
mkdir
<name>
Make a new directory with
the name <name>cp <a> <b>
Copy
file <a> to location <b>
rm
<file>
Remove/Delete
the file with name <file>
mv <a> <b>
Move/Rename file <a>
to location/name <b>
nano
Open
a file editor named
nano
(also known as
pico
)
nano
<file>
Open <file>
with
nano
cat <file>
Outputs the contents of file to the terminal
Slide10By far the commands you will use the most
Compiling
commands
Function
gcc <file>.c
Compile the C program file with name
<file>
.c, use
the generic output name
a.out
gcc <file>.c
–o <file>.out
Compile the C program file with name <file>.c,
use the output name <file>.out
We will discuss these two in more detail on Friday (
gcc compiler
)
Now… what does <file>.c looks like? (AKA what did I get myself into by taking this class?)
Slide11Let’s write a simple program!
Notice: I’ll be using Notepad++ and
pico
/
nano
. You are free to use any IDE of your choosing, under two conditions:
You will have to figure out how to use them on your own (Neither me, nor Rahul the TA will be able to help you if you use an IDE we are not familiar with)
Your projects need to work correctly on the CISE servers using the compile lines we will provide.
Slide12The hello world program
#include <
stdio.h
>
int
main
(
void
)
{
printf
(
"Hello World!"
);
return
0
;
}
Slide13The Even better “hello world” program
#include <
stdio.h
>
int
main
(
void
)
{
printf
(
"Hello World
!\n"
);
return
0
;
}
Slide14Potential content for rest of the class
Other escaped characters (\n,\\,\”, \t,
etc
)
Data types: char,
int
, float.
Variable declarations.
Formatted
printf