String Reference

String Reference - printf"%s%s is your name\n",f,l...

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

View Full Document Right Arrow Icon
//This program demonstrates string parameter passing #include <stdio.h> void load(char*first,char*last) /* in parameter list: char means only 1 character char* means string in function leave off * */ { printf("Enter your First name "); gets(first); printf("Enter your last name "); gets(last); } void main() { char f[20],l[25]; load(f,l);
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 %s is your name\n",f,l); } /* Main first prototype void load(char*,char*); void main() { char f[20],l[25]; load(f,l); //no & on strings printf("%s %s is your name\n",f,l); } void load(char*first,char*last) { printf("Enter your First name "); gets(first); printf("Enter your last name "); gets(last); } */...
View Full Document

Ask a homework question - tutors are online