Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (3) </ [1] 2 3 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: IDE C, looking for an IDE< Next Oldest | Next Newest >
kipman725 Offline





Group: Members
Posts: 9
Joined: June 2007
Posted: Sep. 03 2007,20:32 QUOTE

Hello I am learning c and would like to be able to complie aplications that I make and use some kind of editor that understands the language so can highlight apropriatly on my laptop that runs DSL.  On windows I use Dev-c++ which apears to work fine so something like that would be best.  My laptop isn't very fast (266mhz 196mb ram 4gb HD).

Also will I have to change my programs so they can run inside linux ? currently there very simple and are only use ansi complatible functions (is that the correct phrase??) anyway I will inculde an example of my source code to clarify:

Quote

/* total cost calculator - calculates the price of items */
#include <stdio.h>
main()
{
     float base, vat = 1.175, post, final;
     
     printf("\nItem Calc - with beeps!");
     
     printf("\a\nPlease input the the base price of the item: ");
     scanf(" %f", &base);
     
     printf("\a\nPlease input the postage+packing charge: ");
     scanf(" %f", &post);
     
     final = (base * vat) + post;
     
     printf("\a\nThe total is: %.2f", final);
     return 0;
}

/* don't forget the apersands! */


I started to learn c because it's what the linux kernel is wrote in and I rearly want to be able to help out one day  :)
Back to top
Profile PM 
roberts Offline





Group: Members
Posts: 4983
Joined: Oct. 2003
Posted: Sep. 03 2007,20:58 QUOTE

Not an IDE but....

Use Beaver or Nano editor to change your
#include <stdio.h>

to

#include <tcclib.h>

Then compile with tcc

tcc -o totcost  totcost.c

tcc is built into DSL and is OK for small programs like this.
Later you can use the extension that provides gcc
But with a slow computer you can have fun with tcc

There is a tcc tutorial in the download - current - documentation section.
Back to top
Profile PM WEB 
^thehatsrule^ Offline





Group: Members
Posts: 3275
Joined: July 2006
Posted: Sep. 04 2007,00:06 QUOTE

If you don't wish to use tcc, you could use a fully featured compiler... one of the gcc* extensions would be ideal.

If I remember, beaver has syntax highlighting (though not sure of the defaults in DSL), but it's just an editor.  For an IDE I've used KDevelop, but it's rather heavy on resources.  Personally, I prefer using vim with syntax highlighting, autotabbing, etc.  Here's a list that could be handy: http://linuxmafia.com/faq/Devtools/ides.html

Some misc notes on your code (subject to opinion?):
- specify the return type i.e. int main
- no newline at the end of the last printf?
- it's ampersand ;p
Back to top
Profile PM 
kipman725 Offline





Group: Members
Posts: 9
Joined: June 2007
Posted: Sep. 04 2007,10:19 QUOTE

I think I already have gcc installed so I mayaswell use that, with gcc can I use the <stdio.h> header file still or it there a different one to use?
I'm not sure what is ment by "specify the return type i.e. int main", could you give an example?
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Sep. 04 2007,12:49 QUOTE

Quote
I'm not sure what is ment by "specify the return type i.e. int main"
Specify what type of data will be returned by a function. In the case of main, it is always (or nearly always?) going to be an integer. So instead of using "main()" you use "int main()"


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
10 replies since Sep. 03 2007,20:32 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (3) </ [1] 2 3 >/
reply to topic new topic new poll
Quick Reply: IDE C

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code