You've got the right idea, but you have to declare a function prototype before you call the function. There are two ways to do this. You can put all your called functions before main (programs always start with main, so it doesn't matter if you put it at the end). The other way is to declare just the prototype first.
Code:
#include....
void printname(); // Add this line
int..
float....
void main()
{
printname();
} //end main
void printname()
{
cout<<"my name is ...";
} //end
If you passed any values to printname, include the types in the protoptype:
void printname(int, int, char);
Then make sure you pass the appropriate types when you call printname:
printname(a, b, c); // call printname
.
.
.
void printname(int x, int y, char z) // printname function
{
cout << x << y << z;
}