Multi-module programming in C

Slides:



Advertisements
Similar presentations
CS1020 Week 3: 29th January 2015.
Advertisements

Introduction to the Omega Server CSE Overview Intro to Omega Basic Unix Command Files Directories Printing C and C++ compilers GNU Debugger.
CSE1222: Unix IntroThe Ohio State University1. Common Directory Commands  lsList directory contents  cd {dir}Change working directory to {dir}  pwdPrint.
ENEE150: Discussion 1 Section 0104 Please Sit Down at a Computer and Login!
C Programming Tools Lecturer: Prof. Andrzej (AJ) Bieszczad Phone: “UNIX for Programmers and Users” Third Edition,
Ar: Unix Archiver Lecturer: Prof. Andrzej (AJ) Bieszczad Phone: “UNIX for Programmers and Users” Third Edition, Prentice-Hall,
Basic linux shell commands and Makefiles. Log on to engsoft.rutgers.edu Open SSH Secure Shell – Quick Connect Hostname: engsoft.rutgers.edu Username/password:
CS1020: Intro Workshop. Topics CS1020Intro Workshop Login to UNIX operating system 2. …………………………………… 3. …………………………………… 4. …………………………………… 5. ……………………………………
Object Linking and Embedding A tool which allows different software application packages to share data.
A Mini UNIX Tutorial. What’s UNIX?  An operating system run on many servers/workstations  Invented by AT&T Bell Labs in late 60’s  Currently there.
© Crown copyright Met Office An Introduction to Linux PRECIS Workshop, University of Reading, 23rd – 27th April 2012.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction Unix-like system is everywhere Linux Android for smartphones Google Chrome OS for Chromebook Web.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
Copyright (c) by CNAPTICS Corporation. All rights reserved.1 INFO Oracle Database 11g: Administration II Presented By: Marc S. Paller,
1 N305 C Programming. 2 Objectives for the Lab ä Learn problem solving strategies ä Achieve intermediate knowledge of C Programming Language ä Gain experience.
Vim Editor and Unix Command gcc compiler Computer Networks.
OSP Tutorial An Introduction. Getting to OSP  Obtain a CSE account  Recommend xming to remote log in from USF Website 
ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150.
SEEM3460 Tutorial Tips on Using UNIX. Keyboard shortcuts General Copy: Ctrl+Insert (not Ctrl+c) Cut: Shift+Del (not Ctrl+x) Paste: Shift+Insert (not Ctrl+v)
SEEM3460 Tutorial Multi-module programming in C. Copy the material Create the directory mkdir c_multi cd c_multi mkdir ask cd ask Copy files cp ~seem3460/distribute/c_multi-module/ask/ask_reverse.c.
CGS 3460 Why we choose UNIX n Powerful lMulti-user operating system lGood programming tools Most heavy-duty database management systems started out on.
Executing a C Program Creating the Program Compilation Linking Execution.
Basic Unix Commands CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang.
1May 16, 2005 Week 2 Lab Agenda Command Line FTP Commands Review More UNIX commands to learn File name expansion - * Introduction of vi.
1 Creating Web Services Presented by Ashraf Memon Hands-on Ghulam Memon, Longjiang Ding.
Basic of UNIX For fresh members of SPARCS
Library MANCHESTER Start. How to use the tutorial Open this as a slide show Use INTO sign to move forward To go back use the INTO sign.
Geant Simulation Tutorial 2002 년 6 월 26 일 2002 CHEP 여름학교 서울대학교 김복주 웹페이지 :
Setup Environment: Instructions for CS1520 Server Setup Nils Murrugarra
Unix Servers Used in This Class  Two Unix servers set up in CS department will be used for some programming projects  Machine name: eustis.eecs.ucf.edu.
Make: File Dependency System Lecturer: Prof. Andrzej (AJ) Bieszczad Phone: “UNIX for Programmers and Users” Third.
cs33201 Chapter 12 C Programming Tools Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, 2003.
ENEE150: Discussion 1 Section 0104/0105 Please Sit Down at a Computer and Login!
Makefiles1 MAKEFILES Purpose: contain UNIX commands and will run them in a specified sequence. Syntax Definition : { Section-name: {unix command #1} …
Basic Unix Commands & GCC Saurav Karmakar Spring 2007.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
Computer Programming A simple example /* HelloWorld: A simple C program */ #include int main (void) { printf (“Hello world!\n”); return.
A Mini UNIX Tutorial. What’s UNIX?  An operating system run on many servers/workstations  Invented by AT&T Bell Labs in late 60’s  There are many different.
ICE UNIX TUTORIAL. File System Commands cd – change directory cd – change directory ls – list contents ls – list contents rm – remove/delete rm – remove/delete.
CS 241 Section Week #1 January 26, Topics This Section HW #1 SVN Review (…by the command line!) C Code Examples.
C Programming Lecture 3 : C Introduction 1 Lecture notes : courtesy of Woo Kyun and Chang Byung-Mo.
C 프로그래밍 개발 도구. 컴파일러 gnu c compiler 컴파일 gcc sample.c 실행 a.out 실행 파일 지정 컴파일 gcc –o sample sample.c 실행 sample.
Accessing the Academic Library’s online databases from off-campus When you click on the link to a database that you would like to search, you will be prompted.
Edit the text with your own short phrases. The animation is already done for you; just copy and paste the slide into your existing presentation. PARCC.
Review Why do we use protection levels? Why do we use constructors?
Ar: Unix Archiver Lecturer: Prof. Andrzej (AJ) Bieszczad Phone: “UNIX for Programmers and Users” Third Edition, Prentice-Hall,
Tutorial Six Linux Basics CompSci Semester Two 2016.
Precept I : Lab Environment, Unix, Bash, Emacs
ENEE150 Discussion 01 Section 0101 Adam Wang.
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
SEEM3460 Tutorial Unix Introduction.
CS1010: Intro Workshop.
Tutorial Six Recap & Linux Basics CompSci Semester Two 2016.
Command line arguments
Multi-module programming in C
Log on to and click on the “log in” button
Welcome to CSCI 230! Problem Solving using C
SEEM3460 Tutorial Unix Introduction Xinshi Lin & Zihao Fu
Operating Systems Lecture 5.
How to create your own page on an existing PBWiki site
Separating Definition & Implementation
The Unix File System.
Multi-module programming in C
Tutorial Unix Command & Makefile CIS 5027
The Linux Command Line Chapter 4
Using emacs and G++ at U. W.
3.1 Basic Concept of Directory and Sub-directory
CSC 253 Lecture 15.
Compile and run c files.
The Linux Command Line Chapter 4
Presentation transcript:

Multi-module programming in C SEEM3460 Tutorial Multi-module programming in C

Multi-module programming in C SEEM3460 Tutorial Multi-module programming in C Before we start: Please log on to the server Please recall how to edit text files on Linux/Unix

Copy the material Create the directory Copy files mkdir c_multi cd c_multi mkdir ask cd ask Copy files cp ~seem3460/distribute/c_multi-module/ask/ask_reverse.c ask_reverse.c cp ~seem3460/distribute/c_multi-module/ask/ask_palindrome.c ask_palindrome.c

ask_palindrome (place to start) Framework 1 reverse.o palindrome.o ask_palindrome (place to start) ask_reverse

ask_palindrome.c (place to start) Target Structure reverse.c reverse.h palindrome.c palindrome.h ask_palindrome.c (place to start) ask_reverse.c

Modularizing Reverse reverse.h ask_reverse.c reverse.c void reverse(...); #include <stdio.h> #include <string.h> #include “reverse.h” int main() { ... } void reverse(...) { #include <string.h> #include “reverse.h” void reverse(...) { ... }

Modularizing Reverse Create “reverse.h” and “reverse.c” How to paste under unix: Shift+insert, right click (not in x-win32) With the help of copy and paste >cp ask_reverse.c reverse.c >cp reverse.c reverse.h Edit “reverse.c” and “reverse.h” Edit “ask_reverse.c”

Compile Link .o files as executables: Create .o files: gcc -c reverse.c gcc -c ask_reverse.c Link .o files as executables: gcc -o ask_reverse ask_reverse.o reverse.o

Modularizing palindrome palindrome.c palindrome.h ask_palindrome.c #include <string.h> #include “palindrome.h” int palindrome(...) { ... } int palindrome(...); #include <stdio.h> #include <string.h> #include “palindrome.h” #include “reverse.h” int palindrome(...) { ... } void reverse(...) { int main(...) {

Compile Link .o files as executables: Create .o files: gcc -c palindrome.c gcc -c ask_palindrome.c Link .o files as executables: gcc -o ask_palindrome ask_palindrome.o palindrome.o reverse.o

Framework 2 (for your interest) rectangle.o replace.o print_rect.o label_rect (place to start) area_rect.o cp ~seem3460/distribute/c_multi-module/label/label_rect.c label_rect.c