Hi guys,I'm new in forum.I have a problem.When i write anyone type of function in my IDE(Monodevelop,Ubuntu 16.04) and i call her by main the program run completely but in the terminal don't appear anything why?
In both examples the first line concerns me. It looks like something is not set up correctly. Yet in the second link the for loop appears to work.
In the first link line 13 is a proto type not a function call. Since the function returns a "char" the function needs to return something or the function return type needs to be "void".
Line 13 should look like: char result alphabet(); or just alphabet();.
#include <iostream>
char alphabet() // <-- You declare that this function will return a char...
{
char alpha;
for(alpha='a'; alpha<='z'; alpha++) {
std::cout << alpha;
}
} // <-- ...but it ends returning nothing.
int main()
{
char alphabet(); // <-- this is not a function call: it's a function prototype
// A function call looks like:
// alphabet();
return 0;
}
Note: you can also declare the variable ‘alpha’ inside the for-loop block:
Note 2: if you really want an answer, you should consider copying ans pasting your code inside the post, from where other users can take it and test it. In general, if you don't help other people help you, other people think you aren't really searching for help.