A couple of days ago I decided to try and make some programs in C.
I've never used any non interpreted language before (and even then my experience is pretty minimal).
What I am wondering though is, so far if I compile something on one of my computers (one has fedora, the other has gentoo), it doesn't run on the other one. I kind of expected that. One of them is 32bit and the other 64bit for one thing. And on gentoo I put march native in my make.conf.
But I gather it must be possible to compile things that work on various computers, otherwise you wouldn't be able to download binaries and run them on most ordinary PC's.
So how do you go about it? Is there somewhere where you can make once off choices to compile something very generically (since generally I wouldn't be compiling stuff to use it on both computers, and even now with the 3 line programs I am writing its not exactly a big deal, I am really just curious)?
And I suppose generally if I were going to do that I'd have to compile it on the 32bit computer then it can be used on both? But it won't work the other way round? Or am I wrong?