Homework-I

Homework-I - In the main body of your program, create a...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Fall 2010 CSC 4304 – Systems Programming Homework Assignment #1 The due date is: September 9 th , Thursday, before the class. Late submission is not allowed. Copy all of your code into a text file, rename it to hw1_yourlastname , and email to thanks@csc.lsu.edu , cc to kosar@cct.lsu.edu Problem 1: Write a function my_strncpy() that copies one string into another just like strncpy(). You can only use <stdio.h> in your program. Problem 2: Write a function my_strcmp() which takes two strings and compares them (similar to strcmp). If two strings are equal, return 0, else return any other value. You can only use <stdio.h> in your program. Problem 3:
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: In the main body of your program, create a structure with three integer fields. Write a function add_fields() which takes the structure as a parameter, adds the first two fields and stores the result in the third field. Function main() initializes the structure, calls the add_fields() function, then prints the fields of the structure. Problem 4: Write a program which takes two file names as argument from command line, reads the contents of the first file into the memory, and writes its contents to the second file in reverse order. You need to use file I/O functions such as open, close, read, write, lseek etc....
View Full Document

Ask a homework question - tutors are online