I'm unable to make these programs and have to submit on thursday!!:'(
Q. Make a header file that contains the function definitions of all the function prototypes
defined below:
• int strlen(char *);
• void strcpy (char*, char*);
• void strcat(char *, char *);

Q.Using unions, write a program that asks the user whether he wants to input a string or a list
of 5 elements. If the user selects to input string then call a function that takes the string as
input and prints it. If he selects the latter, then take the 5 numbers as input and print them.

Q. Write a recursive procedure that returns the smallest value in an array of 10 elements.

Recommended Answers

All 4 Replies

Please read this

Post the code you have so far, we're not going to make your homework for you...

>I'm unable to make these programs and have to submit on thursday!!
Whining about it doesn't accomplish anything. The questions aren't difficult if you were paying attention in class, so you've only yourself to blame. Take the failing grade and learn your lesson, is my advice.

>Q. Make a header file that contains the function definitions of all the function prototypes
I don't like the wording of this question. Function definitions shouldn't be in a header because unless you're very careful you'll get errors, and even when you're very careful, the result is confusing.

>Q.Using unions, write a program [...]
One could argue that unions are an unnecessary part of the language for the majority of programmers.

>Q. Write a recursive procedure that returns the smallest value in an array of 10 elements.
I don't like this question either. It suggests that recursion is a good solution for linear algorithms where a simple loop is both shorter and simpler.

Q. Make a header file that contains the function definitions of all the function prototypes
defined below:
• int strlen(char *);
• void strcpy (char*, char*);
• void strcat(char *, char *);

This one is simple just copy the function prototypes in a file say header.h , you should first put some effort on doing your homework .

>This one is simple just copy the function prototypes in a file say header.h
Not quite. The question refers to function definitions. A prototype is only a declaration, not a definition.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.