So is right for the first? |
After having applied salem c’s corrections, you also need to include <string>, because you use it, but you can delete <ctime>, <cmath> and <cstdlib>, because you don't use them.
(And you could improve the code indentation, I think.)
About the second exercise, just try to describe yourself the problem:
1) I need a function func_name();
"The function receives twice as parameters." <-- I can't understand this (twice means two times
https://en.oxforddictionaries.com/definition/twice
Should your function get two strings and two characters? I don't think so. I think the exercise says the function should get two strings):
2) example of partial function prototype: func_name(std::string first, std::string second)
3) What is the expected return value? "...returns the empty string, otherwise it returns the string..."
Once you have written the basic prototype, do get on:
4) Inside that function, the first step is to check if... ?
"If the strings have different lengths..."
After having solved that, do deal with the biggest issue:
"the string chaining the characters of the first with the second alternately"
(which is not that big, actually)
I suggest not trying to do everything at the first attempt; perhaps it is better to manage it step by step.