Hey guys!
It's all coming along nicely now. Much less confused than before, but still so so far from being independent
This morning I ran into a problem. I've tried to use headers because I love being able to create little pieces of code that create functions and orginize them correctly. But I'm doing something wrong.
I have three files. One is my main project with int main() that includes the header, then there is a header which is a .h file declaring a function, and lastly a .cpp file to define what the function does.
Code:
#include <iostream.h>
#include "Head.h"
using namespace std;
int main(){
cout << "Testing. Next line is a function. \n";
Function();
system("PAUSE");
return 0;
}
Code:
#include <iostream.h>
using namespace std;
void Function(){
cout << "Testing... 1, 2, 3... It works!";
}
The problem is that it doesn't quite work. cout that should print the text in function Function isn't printing the text. So that sucks!
Apart from that. Right now I have one header and one cpp file for every function I make. I assume I could just have one header called "SoundHandling" and have like 30 functions in there to handle sound(for example)?
Also, right now my functions and headers are visible to anyone. Could I include them in my project, and then save the project as some encrypted executable? Like have a few cpp files with functions included in my project (In Dev-C++ under my main cpp file in the list on the left.) and a header as well. I hope I'm making sence
Edit ------------
Oh, and I assume that iostream is a header that includes alot of basic functions like cout. Does every computer have this file, or did it come with my compiler and must I include it as well?
Apart from that. What is the .o file, and .win file. Should I include them as well when sharing my program with others?