473,327 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Which C tool?

Hi

I have a copy of Visual Studio 2005 and Borland Delphi but I'm at a
loss to find where I can start to code C applications, they all give me
options to work in C++ but as I am dealing with embedded systems and
PIC devices I can't use it.

Does anyone know if I can get Visual Studio, I think its better than
Borland, to work with C or failing that what is the best C programing
tool?

Thanks,

JB

Nov 1 '06 #1
23 2497
On 31 Oct 2006 17:17:07 -0800
jo***********@isfis.com wrote:
Hi

I have a copy of Visual Studio 2005 and Borland Delphi but I'm at a
loss to find where I can start to code C applications, they all give
me options to work in C++ but as I am dealing with embedded systems
and PIC devices I can't use it.

Does anyone know if I can get Visual Studio, I think its better than
Borland, to work with C or failing that what is the best C programing
tool?
I suggest programming with vim. Other people may prefer emacs. They are
both great editors and they should suit your needs.
Nov 1 '06 #2
On Tue, 31 Oct 2006 22:41:05 -0300
Rafael Almeida <ra*****@dcc.ufmg.brwrote:
On 31 Oct 2006 17:17:07 -0800
jo***********@isfis.com wrote:
Hi

I have a copy of Visual Studio 2005 and Borland Delphi but I'm at a
loss to find where I can start to code C applications, they all give
me options to work in C++ but as I am dealing with embedded systems
and PIC devices I can't use it.

Does anyone know if I can get Visual Studio, I think its better than
Borland, to work with C or failing that what is the best C
programing tool?

I suggest programming with vim. Other people may prefer emacs. They
are both great editors and they should suit your needs.
It sounds like you're working in Windows. I'd suggest either GVim for
an editor or DevC++ if you're looking for an IDE.

==
Adam Shea
Nov 1 '06 #3
I have a copy of Visual Studio 2005 and Borland Delphi but I'm at a
loss to find where I can start to code C applications, they all give me
options to work in C++ but as I am dealing with embedded systems and
PIC devices I can't use it.

Does anyone know if I can get Visual Studio, I think its better than
Borland, to work with C or failing that what is the best C programing
tool?
You may need something specific to your device or PIC. E.g. MicroChip
has their own C compiler for their PIC line, and there are third party
compilers specific to certain devices as well.

Depending on what you're doing, you may be able to use Visual Studio -
files that end in .c (not .cc or .cpp) are by default compiled as C
code, or you can set file-by-file or project-by-project settings to
compile as C instead of as C++ (under C/C++ Advanced). To write stuff
for an embedded device, you may need to download extensions that
support WinCE, which can be found by googling.

Michael

Nov 1 '06 #4
On 31 Oct 2006 19:40:14 -0800, "Michael" <mc******@aol.comwrote in
comp.lang.c:
I have a copy of Visual Studio 2005 and Borland Delphi but I'm at a
loss to find where I can start to code C applications, they all give me
options to work in C++ but as I am dealing with embedded systems and
PIC devices I can't use it.

Does anyone know if I can get Visual Studio, I think its better than
Borland, to work with C or failing that what is the best C programing
tool?

You may need something specific to your device or PIC. E.g. MicroChip
has their own C compiler for their PIC line, and there are third party
compilers specific to certain devices as well.

Depending on what you're doing, you may be able to use Visual Studio -
files that end in .c (not .cc or .cpp) are by default compiled as C
code, or you can set file-by-file or project-by-project settings to
compile as C instead of as C++ (under C/C++ Advanced). To write stuff
for an embedded device, you may need to download extensions that
support WinCE, which can be found by googling.

Michael
I am wiping tears from my eyes from laughing so hard, but I just had
to respond even though it's way off-topic...

The notion of the incredible resource hogging, bloated POS WinCE
running on a PIC!

Pull the other one.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 1 '06 #5

jo***********@isfis.com wrote:
Hi

I have a copy of Visual Studio 2005 and Borland Delphi but I'm at a
loss to find where I can start to code C applications, they all give me
options to work in C++ but as I am dealing with embedded systems and
PIC devices I can't use it.

Does anyone know if I can get Visual Studio, I think its better than
Borland, to work with C or failing that what is the best C programing
tool?

Thanks,

JB
I've been around the block a few times on editors and keep coming back
to Jen's File Editor
http://home.arcor.de/jensaltmann/JFE/jfe_eng.htm

Its buggy and kind of annoing at times. However I find it perfect for
big C projects with fairly flat directory structures. Beware, it loads
all text files into RAM, but this makes searching through files fast.
It also has a look/feel like Visual Studio.

Editplus is not bad either (google editplus). However its not freeware.

I'd honestly keep playing around with different editors until you found
one to your liking.

Nov 1 '06 #6
Thanks for the help, I'll have a look at the tools you mentioned. I
use tiny bootloader to work with pic 18f/16f devices and I suppose I
could write in notepad for all its worth but I've always been more
comfortable with IDEs.

Thanks,

JB

Nov 1 '06 #7
On 31 Oct 2006 17:17:07 -0800, jo***********@isfis.com wrote:
>I have a copy of Visual Studio 2005 and Borland Delphi but I'm at a
loss to find where I can start to code C applications, they all give me
options to work in C++ but as I am dealing with embedded systems and
PIC devices I can't use it.
You can, of course, write programs in C with Visual Studio 2005. The
Windows API is written in C.
>Does anyone know if I can get Visual Studio, I think its better than
Borland, to work with C or failing that what is the best C programing
tool?
- Create a console project
- Remove all generated files like "stdafx.h"
- Add your files with *.c extension

I've just compiled the following program in Visual Studio 2005 (note
it's C: no prototypes, no cast for malloc)

int main() {
char* c = malloc (100);
strcpy (c, "Hello, world!");
printf ("%s", c);
free (c);
}

//Compiler output: C_Test - 0 error(s), 5 warning(s)

If you just want an editor (not an IDE) on Windows take a look at the
great freeware PSPad: http://www.pspad.com/en/

Best wishes,
Roland Pibinger
Nov 1 '06 #8

Jack Klein wrote:
On 31 Oct 2006 19:40:14 -0800, "Michael" <mc******@aol.comwrote in
comp.lang.c:
I have a copy of Visual Studio 2005 and Borland Delphi but I'm at a
loss to find where I can start to code C applications, they all give me
options to work in C++ but as I am dealing with embedded systems and
PIC devices I can't use it.
>
Does anyone know if I can get Visual Studio, I think its better than
Borland, to work with C or failing that what is the best C programing
tool?
You may need something specific to your device or PIC. E.g. MicroChip
has their own C compiler for their PIC line, and there are third party
compilers specific to certain devices as well.

Depending on what you're doing, you may be able to use Visual Studio -
files that end in .c (not .cc or .cpp) are by default compiled as C
code, or you can set file-by-file or project-by-project settings to
compile as C instead of as C++ (under C/C++ Advanced). To write stuff
for an embedded device, you may need to download extensions that
support WinCE, which can be found by googling.

Michael

I am wiping tears from my eyes from laughing so hard, but I just had
to respond even though it's way off-topic...

The notion of the incredible resource hogging, bloated POS WinCE
running on a PIC!

Pull the other one.
No one ever said it had to run *well*.

Nov 1 '06 #9
Roland Pibinger wrote:
I've just compiled the following program in Visual Studio 2005 (note
it's C: no prototypes, no cast for malloc)
Prototypes are encouraged for C code. You really should use int
main(void), and also include <stdio.h>, <stdlib.hand <string.hto
provide prototypes for the functions you call.
int main() {
char* c = malloc (100);
strcpy (c, "Hello, world!");
printf ("%s", c);
free (c);
}

//Compiler output: C_Test - 0 error(s), 5 warning(s)
Here are the 5 diagnostics your code produces:

'malloc' undefined; assuming extern returning int
'initializing' : 'char *' differs in levels of indirection from 'int'
'strcpy' undefined; assuming extern returning int
'printf' undefined; assuming extern returning int
'free' undefined; assuming extern returning int

These are _real_ problems. They may not prevent the code from working on
your 32-bit system, but just wait until someone tries to run it on a
64-bit system where ints and pointers have a different size.

They can all be fixed by including the required header files.

--
Simon.
Nov 1 '06 #10
On 31 Oct 2006 17:17:07 -0800, jo***********@isfis.com wrote:
>Hi

I have a copy of Visual Studio 2005 and Borland Delphi but I'm at a
loss to find where I can start to code C applications, they all give me
options to work in C++ but as I am dealing with embedded systems and
PIC devices I can't use it.

Does anyone know if I can get Visual Studio, I think its better than
Borland, to work with C or failing that what is the best C programing
tool?
This group deals with the language as defined by the standard, not
with the compilers that process the code. Try the microsoft.public.vc
hierarchy for questions about using VS for C.
Remove del for email
Nov 1 '06 #11
On Thu, 02 Nov 2006 02:09:12 +1100, Simon Biber <ne**@ralmin.cc>
wrote:
>Here are the 5 diagnostics your code produces:

'malloc' undefined; assuming extern returning int
'initializing' : 'char *' differs in levels of indirection from 'int'
'strcpy' undefined; assuming extern returning int
'printf' undefined; assuming extern returning int
'free' undefined; assuming extern returning int

These are _real_ problems. They may not prevent the code from working on
your 32-bit system, but just wait until someone tries to run it on a
64-bit system where ints and pointers have a different size.
They can all be fixed by including the required header files.
That's understood. I just wanted to be sure that VS 2005 compiled the
program as C program, not as C++ program. Therefore I needed program
that was valid in C but not in C++.

Best regards,
Roland Pibinger
Nov 1 '06 #12
jo***********@isfis.com wrote:
>
Hi

I have a copy of Visual Studio 2005 and Borland Delphi but I'm at a
loss to find where I can start to code C applications, they all give me
options to work in C++ but as I am dealing with embedded systems and
PIC devices I can't use it.

Does anyone know if I can get Visual Studio, I think its better than
Borland, to work with C or failing that what is the best C programing
tool?
Well, ignoring the "what is the best" part of the question...

VS2005 should handle C programs just fine. (Unless Microsoft really
screwed everyone over by removing that possibility.) Just don't use
any of the "wizards", and start with an "empty project". Then add
your C source (with ".c" extensions) to the project. At least this
is how earlier versions of Visual Studio did it.

If this doesn't work, or you need further help, you'll need to ask in
one of the Microsoft- or Windows-specific newsgroups.

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h|
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:Th*************@gmail.com>

Nov 1 '06 #13
Roland Pibinger wrote:
On Thu, 02 Nov 2006 02:09:12 +1100, Simon Biber <ne**@ralmin.cc>
wrote:
>Here are the 5 diagnostics your code produces:

'malloc' undefined; assuming extern returning int
'initializing' : 'char *' differs in levels of indirection from 'int'
'strcpy' undefined; assuming extern returning int
'printf' undefined; assuming extern returning int
'free' undefined; assuming extern returning int

These are _real_ problems. They may not prevent the code from working on
your 32-bit system, but just wait until someone tries to run it on a
64-bit system where ints and pointers have a different size.
They can all be fixed by including the required header files.

That's understood. I just wanted to be sure that VS 2005 compiled the
program as C program, not as C++ program. Therefore I needed program
that was valid in C but not in C++.
Based on those warnings I don't think the program is valid C either. The
C standard explicitly allows compilers to compile invalid programs even
where it requires that the compiler produce some kind of diagnostic
message, where a diagnostic message could be as unhelpful as, "I think
you stink."

If you wand a program that is valid C but invalid C++ here are a few
simple examples

int main(void)
{
int new;
return 0;
}

int main(void)
{
int i;
void *p = &i;
return 0;
}

int main(void)
{
int class;
return 0;
}

You may get warnings about unused variables, but all of the above are
strictly conforming C programs but any C++ compiler is required to
produce a diagnostic for every one of them. Of course, if the C++
standard is anything like the C standard the compiler could just
generate a warning but compile the code anyway.
--
Flash Gordon
Nov 1 '06 #14
Flash Gordon wrote:
If you wand a program that is valid C but invalid C++ here are a few
simple examples
[...]
int main(void)
{
int i;
void *p = &i;
return 0;
}
This is both valid C and valid C++. The conversions in the opposite
direction are the ones that are disallowed in C++.

Nov 1 '06 #15
Flash Gordon <sp**@flash-gordon.me.ukwrites:
[...]
If you wand a program that is valid C but invalid C++ here are a few
simple examples

int main(void)
{
int new;
return 0;
}
[snip]

Or if you want the program to tell you at run time:

#include <stdio.h>
int main(void)
{
if (sizeof(int) == 1) {
printf("Can't tell\n");
}
else if (sizeof 'x' == sizeof(int)) {
printf("This is C\n");
}
else if (sizeof 'x' == 1) {
printf("This is C++\n");
}
else {
printf("Compiler bug?\n");
}
return 0;
}

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 1 '06 #16
Harald van Dijk wrote:
Flash Gordon wrote:
>If you wand a program that is valid C but invalid C++ here are a few
simple examples
[...]
>int main(void)
{
int i;
void *p = &i;
return 0;
}

This is both valid C and valid C++. The conversions in the opposite
direction are the ones that are disallowed in C++.
Well, 2 out of 3 ain't bad.
--
Flash Gordon
Nov 1 '06 #17
Roland Pibinger wrote:
>
.... snip ...
>
That's understood. I just wanted to be sure that VS 2005 compiled
the program as C program, not as C++ program. Therefore I needed
program that was valid in C but not in C++.
#include <stdio.h>
int main(void) {
char class[24];
const char *new = "I am a C compiler";

strcpy(class, new);
puts(new);
return 0;
}

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
Nov 1 '06 #18
On Wed, 01 Nov 2006 16:57:06 -0500, CBFalconer <cb********@yahoo.com>
wrote:
>Roland Pibinger wrote:
>>
... snip ...
>>
That's understood. I just wanted to be sure that VS 2005 compiled
the program as C program, not as C++ program. Therefore I needed
program that was valid in C but not in C++.

#include <stdio.h>
int main(void) {
char class[24];
const char *new = "I am a C compiler";

strcpy(class, new);
puts(new);
return 0;
}
warning C4013: 'strcpy' undefined; assuming extern returning int

I think you need to include <string.h>. In VS 2005, or VS 6 for that
matter, just double-click on "strcpy" and press F1 to get the best
help on the planet. Thanks Microsoft.

--
jay
Nov 2 '06 #19
jaysome said:

<snip>
>
warning C4013: 'strcpy' undefined; assuming extern returning int

I think you need to include <string.h>.
Correct.
In VS 2005, or VS 6 for that
matter, just double-click on "strcpy" and press F1 to get the best
help on the planet.
<coughNo comment.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Nov 2 '06 #20
jaysome wrote:
CBFalconer <cb********@yahoo.comwrote:
>Roland Pibinger wrote:
>>>
... snip ...
>>>
That's understood. I just wanted to be sure that VS 2005 compiled
the program as C program, not as C++ program. Therefore I needed
program that was valid in C but not in C++.

#include <stdio.h>
int main(void) {
char class[24];
const char *new = "I am a C compiler";

strcpy(class, new);
puts(new);
return 0;
}

warning C4013: 'strcpy' undefined; assuming extern returning int

I think you need to include <string.h>. ... snip ...
You are correct.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>

Nov 2 '06 #21
John Bode wrote:
Jack Klein wrote:
>On 31 Oct 2006 19:40:14 -0800, "Michael" <mc******@aol.comwrote in
comp.lang.c:
>>>I have a copy of Visual Studio 2005 and Borland Delphi but I'm at a
loss to find where I can start to code C applications, they all give me
options to work in C++ but as I am dealing with embedded systems and
PIC devices I can't use it.

Does anyone know if I can get Visual Studio, I think its better than
Borland, to work with C or failing that what is the best C programing
tool?
You may need something specific to your device or PIC. E.g. MicroChip
has their own C compiler for their PIC line, and there are third party
compilers specific to certain devices as well.

Depending on what you're doing, you may be able to use Visual Studio -
files that end in .c (not .cc or .cpp) are by default compiled as C
code, or you can set file-by-file or project-by-project settings to
compile as C instead of as C++ (under C/C++ Advanced). To write stuff
for an embedded device, you may need to download extensions that
support WinCE, which can be found by googling.

Michael
I am wiping tears from my eyes from laughing so hard, but I just had
to respond even though it's way off-topic...

The notion of the incredible resource hogging, bloated POS WinCE
running on a PIC!

Pull the other one.

No one ever said it had to run *well*.
On a PIC? Not at all.
Nov 3 '06 #22
jo***********@isfis.com wrote:
Hi

I have a copy of Visual Studio 2005 and Borland Delphi but I'm at a
loss to find where I can start to code C applications, they all give me
options to work in C++ but as I am dealing with embedded systems and
PIC devices I can't use it.

Does anyone know if I can get Visual Studio, I think its better than
Borland, to work with C or failing that what is the best C programing
tool?

Thanks,

JB
To write C for a PIC you Need a cross-compiler
Hi-Tech C, CSS or microchipC
details at microchipC.com

For visual Studio .C files are treated as C.
Delphi is a different language.
Nov 3 '06 #23
Simon Biber wrote:
Roland Pibinger wrote:
I've just compiled the following program in Visual Studio 2005 (note
it's C: no prototypes, no cast for malloc)

Prototypes are encouraged for C code. You really should use int
main(void), and also include <stdio.h>, <stdlib.hand <string.hto
provide prototypes for the functions you call.
I think the poster was trying to show VS2005 was compiling the code
as C and not C++ (ie the code would not compile without errors if
the C++ compiler was in fact doing the compiling).

Jussi Jumppanen
Author: Zeus for Windows IDE - http://www.zeusedit.com

Nov 5 '06 #24

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: _andrea.l | last post by:
how to build a interfaces (or web pages) in easy way? how to build a form in easy way? how to automate and create web pages whit a tool? which tool to use to create form for a database? I mean...
38
by: BORT | last post by:
Please forgive me if this is TOO newbie-ish. I am toying with the idea of teaching my ten year old a little about programming. I started my search with something like "best FREE programming...
7
by: SQLDBA | last post by:
I am in the process of evaluating some SQL Performance Monitoring /DBA tool to purchase (For SQL Server 2000). I have the following list of software that I came across and have to finalize which...
1
by: hico74 | last post by:
Hi all. I'm looking for a tool which should act like some kind of middleware/ logical layer bewtween the SQL server and the webbased user interface. - It should be possible to easily create...
3
by: for.fun | last post by:
Hi everybody, I am looking for a XML comparison tool (I do not mean a standard char-by-char diff tool but a tool which understand XML syntax) More precisely, I can have serveral XML...
17
by: clintonG | last post by:
I'm using an .aspx tool I found at but as nice as the interface is I think I need to consider using others. Some can generate C# I understand. Your preferences please... <%= Clinton Gallagher ...
6
by: Anastasios Hatzis | last post by:
Hello, I'm working on the light-weight MDA tool pyswarm, http://pyswarm.sourceforge.net/ (it is about a code-generator for Python/PostgreSQL-based software. I plan to add support of UML CASE...
1
by: JSievers | last post by:
Hallo. A good friend of me develops web suites, for example his own at: www.augenpunkte.de. As you can see there my friend is blind and also he uses a Braille-line to develop these projects. For...
0
by: Georg Scholz | last post by:
(Note: this was intended to be a multi-post, but google was not able to post it also to microsoft.public.dotnet.general, so I'm cross- posting it separately) Hello, I am about to write a...
9
by: antonyliu2002 | last post by:
By default, IIS is configured to timeout a session in 20 minutes, which can be changed through the IIS config window. I use InProc sessionState mode. I can also set the session timeout in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.