Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Getting started in C on the PC.

Status
Not open for further replies.

Pommie

Well-Known Member
Most Helpful Member
My son has recently become interested in programming and he introduced me to CodeBlocks. It's an open source C++ IDE that I find very easy to use. If you install the version that includes the mingw compiler ( choose second from bottom for windows. Once installed you can use the project wizard to do simple console applications - the wizard defaults to "Hello world".

I've just had a play with the SDL library and made myself a firework. If anyone is interested I've attached the C code and the exe. I'm rather pleased with my little venture into windows C++ programming.:D

<edit>Just realised, the exe won't work without the SDL.DLL, just (google and) download it and stick it in windows/system32.</edit>

Mike.
 

Attachments

  • Firework.zip
    123.3 KB · Views: 226
Last edited:
Hey pommie great job.DUDE that program is great when did you start programing.It looks great with a perfect changing of colors. I took a look at the sourse code. good job, it is very neat and tidy. check out my latest program i made the other day. Ive been programing on and off for the last month or two.

Code:
#include <iostream>
using namespace std;
int main ()
{
    system("TITLE C2F");
    system("COLOR 2");
    system("PAUSE");
    system("cls");
int i;
  cout << "Please enter the degrees in Celcius: ";
  cin >> i;
  cout << "That number in fahrenheit is: " << (i*1.8)+32 << " degrees" ".\n";
        cin.ignore(1);
      cout << "Press ENTER to exit...";
  cin.get();
  return 0;
}

feel free to add to it or make any changes.
 

Attachments

  • C2F.zip
    147.3 KB · Views: 238
Last edited:
I've been learning c and a little c++ with codeblocks and I find it very user freindly. I've had a dabble with wxWidgets as well which seems quite good.

The following links have been helful too, but you're probably beyond this.

**broken link removed**

**broken link removed**
 
Everyone is entitled to their own views and opinions.

C++ is in my mind more then a bit of an abortion.

If you want to learn/use C learn C.

If you want to learn/use an object oriented C like language learn C# or mono.

3v0
 
Everyone is entitled to their own views and opinions.
C++ is in my mind more then a bit of an abortion.
3v0

If you look at the source code it is actually standard C. I'm not very comfortable with OO.

David,
I started programming around 1980 :eek: and so I've had a bit of experience. I downloaded Dev-C++ and managed to get the above (firework) code to compile and run (as a C file not C++). It was a bit of a pain getting it to include the right lib files but after that it worked fine. If you want to play around with graphics/games then SDL is not a bad starting place.

Mike.
 
If you look at the source code it is actually standard C. I'm not very comfortable with OO.

David,
I started programming around 1980 :eek: and so I've had a bit of experience. I downloaded Dev-C++ and managed to get the above (firework) code to compile and run (as a C file not C++). It was a bit of a pain getting it to include the right lib files but after that it worked fine. If you want to play around with graphics/games then SDL is not a bad starting place.

Mike.

1980 you got a good 28 year head start on me. and 14 years of you knowing programing i was not even alive. yeah i love DevC++. in linux i just use a text based gcc compiler and make the code in nano or emac. The C2F program is the only use full one that does somthing good. i have a even or odd one. it just tells you if a number if even or odd.
 
Last edited:
Hi,

Dont forget to check out the Watcom compiler that is free and open source too.
It's pretty nice and they update it now and then.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top