Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #define MAX_CHARS 1000
- void encode(char *s1, char *s2);
- int read_line(char *str, int n);
- int main(void)
- {
- int word_chars;
- char wrds[MAX_CHARS+1];
- char wrds2[MAX_CHARS+1];
- printf("Enter a word: ");
- word_chars = read_line(wrds, MAX_CHARS);
- encode(wrds,wrds2) //And i know in my mind how to call it but don't know to
- // write it
- printf("Output: %s", wrds2);
- return 0;
- }
- void encode(char *s1, char *s2) //this is the function i need help with
- { //please!
- char *func_ptr1 =s1; char *func_ptr2=s2; //This is how far I have got to.
- char *temp_ptr=s1; //I am getting frustrated and have
- //no clue what to do.
- for(func_ptr1=s2; *s1 != '