Lab09.4 - printf"%s\n"&words[2[2 replace"grey" with"great" using a function myStrcpy(words[0"great"

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

View Full Document Right Arrow Icon
Sheet1 Page 1 #include <stdio.h> #include <string.h> /* *A program that */ void myStrcpy(char dest[], char src[]) int main(){ char words[3][10] = {"grey", "green", "greasy"} /* changing first e in "green" to 'y' */ words[1][2] = 'y' printf("%s\n", words[1]) /* prints the third word */ printf("%s\n", words[2]) /* print "easy" without changing the array */
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: printf("%s\n", &words[2][2]) /* replace "grey" with "great" using a function */ myStrcpy(words[0], "great") printf("%s\n", words[0]) return (0) } void myStrcpy(char dest, char src){ int i = 0 while(src[i] != '\0'){ dest[i] = src[i] i++ } i++ dest[i] = '\0' return }...
View Full Document

This lab report was uploaded on 04/06/2008 for the course CISC 105 taught by Professor Mcgeary during the Spring '08 term at University of Delaware.

Ask a homework question - tutors are online