-
Newbie to Programming.
Hello everyone. :D
I am new to programming, i decided to learn C, because from what ive been reading most languages are based on this.
I brought the book: C programming in easy steps.
http://www.countrybookshop.co.uk/ima...184078203X.jpg
Now Ive install the compiler, it's called dev-C++ (It can compile C and C++, and seemed easy so I got that) and Ive writen my first "Hello world" Program. Is it okay to use the run -> compile option on the software, is that the same as typing all that stuff in to the command prompt, because that didnt work for me.
Now, I skimmed through the book, and everything is in command prompt. Im new so this maybe a stupid question, but cant I create programs that have an interface or something like that?
Im moving on to variables next. :)
-
It is possible to create GUIs for your program but I would not recommend it, considering your experience and knowledge
-
> Is it okay to use the run -> compile option on the software,
> is that the same as typing all that stuff in to the command prompt, because that didnt work for me.
There's an option somewhere in that dialog which allows you to specify what the command line parameters will be.
So where you would type on the command line
myprog.exe input.txt
There's a field on the dialog where you would enter
input.txt
Apart from that, it should be the same.
-
Creating a neat GUI will take a lot of work and experience. Consider Hello World:
Console
Code:
#include <iostream>
int main()
{
std::cout << "Hello World!\n";
getchar();
}
Windows GUI
Code:
#include <windows.h>
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hInstNULL, LPSTR lpszCmdLine, int nCmdShow)
{
return MessageBox(
NULL,
"Hello World",
"Tutorial Example 1",
MB_OK|MB_ICONINFORMATION);
}
;)
-
IMHO you're just starting C, so don't worry about GUIs at the moment. Get to grips with the concepts that the book you bought is presenting (I have that book too)!
When you feel ready, may I recommend this book: http://www.amazon.co.uk/exec/obidos/...640125-4565469
It taught me most of what I know and use today.
Once you get to grips with C and how it works, you can then quite easily move onto graphical programs using a graphical library for C such as GTK+ (http://www.gtk.org/)
-
Or you could use a more GUI-oriented language such as C# if you're looking to create a snazzy interface. There's no sense (IMO) putting all that effort in to try and generate a C GUI when the language is not really designed for the purpose. You can always perform computationally expensive processing in C and pass the data between a DLL and the application if you need the speed.