Home > Archive > Visual Studio > September 2004 > using C sourcecode?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
using C sourcecode?
|
|
| Paul Fedorenko 2004-09-12, 3:56 am |
| This is going to seem like a braindead, overly simple question to most
people, but I'm going to ask it anyway since I'm somewhat baffled...
I've got the academic version of Visual Studio .net. I'm a programming
student, and got the software from a friend who no longer needed it, so I've
got all the CD's, including the rather extensive MSDN documentation library.
I've also never used the program before, and only just installed it. At the
moment, I'm learning C at school, but whenever I open a new console
application project under Visual Studio, it defaults to C++, without the
option of changing the language. Since I don't actually know C++, I'd like
to be able to change that to C instead. The other two IDEs I've fiddled
around with give the option, so I'd be very surprised if this one didn't.
None of the help files that came with the software have any useful
information on this issue, and the two books that came with it are a less
than useless.
Anyway, if anyone could help me out with this one, I'd definitely appreciate
it.
| |
| Sylvain Lafontaine 2004-09-12, 3:56 am |
| Excerpt for some very esoteric features, you can look at C++ simply as C
with more features. Nearly about everything you write in C will run the
same under a C++ compiler. (However, the inverse is quite not true.)
S. L.
"Paul Fedorenko" <pfedorenko@look.ca> wrote in message
news:eaY5SHImEHA.3288@TK2MSFTNGP10.phx.gbl...
> This is going to seem like a braindead, overly simple question to most
> people, but I'm going to ask it anyway since I'm somewhat baffled...
>
> I've got the academic version of Visual Studio .net. I'm a programming
> student, and got the software from a friend who no longer needed it, so
> I've got all the CD's, including the rather extensive MSDN documentation
> library. I've also never used the program before, and only just installed
> it. At the moment, I'm learning C at school, but whenever I open a new
> console application project under Visual Studio, it defaults to C++,
> without the option of changing the language. Since I don't actually know
> C++, I'd like to be able to change that to C instead. The other two IDEs
> I've fiddled around with give the option, so I'd be very surprised if this
> one didn't.
>
> None of the help files that came with the software have any useful
> information on this issue, and the two books that came with it are a less
> than useless.
>
> Anyway, if anyone could help me out with this one, I'd definitely
> appreciate it.
>
| |
| Paul Fedorenko 2004-09-12, 8:56 pm |
|
"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
wrote in message news:eNz1dDJmEHA.3608@TK2MSFTNGP09.phx.gbl...
> Excerpt for some very esoteric features, you can look at C++ simply as C
> with more features. Nearly about everything you write in C will run the
> same under a C++ compiler. (However, the inverse is quite not true.)
>
> S. L.
So I can just put my C code into the .cpp file that VS opens up by default
with a new project, save it as a .cpp file, and it'll happily compile with
no problems?
| |
| Sylvain Lafontaine 2004-09-13, 3:57 am |
| Yes.
The difference that you will see about the name of the main point of entry
and of the inclusion of standard include files doesn't come because you are
compiling a C++ program instead of a C program but because it will run under
the Windows environment.
Also, don't mix .cpp with .c files: always use .cpp files only.
The reason for this is that C functions doesn't have the same internal names
inside the .OBJ and .DLL files than C++ functions and the linker won't be
able to correctly link your program into an EXE if you mix these two types
of convention without taking some extra steps.
By using only .CPP files, you will ensure to use the same internal naming
convention for all of your functions. It won't make any difference on the
code that you can write.
Instead of C and of C++, which are old stuff, you should study C#: much more
easy, modern and powerful to begin with than C or C++.
S. L.
"Paul Fedorenko" <pfedorenko@look.ca> wrote in message
news:ek8jc6QmEHA.2380@TK2MSFTNGP14.phx.gbl...
>
> "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
> wrote in message news:eNz1dDJmEHA.3608@TK2MSFTNGP09.phx.gbl...
>
> So I can just put my C code into the .cpp file that VS opens up by default
> with a new project, save it as a .cpp file, and it'll happily compile with
> no problems?
>
| |
| Paul Fedorenko 2004-09-13, 3:57 am |
| > Instead of C and of C++, which are old stuff, you should study C#: much
> more easy, modern and powerful to begin with than C or C++.
Thanks for the info you posted. As for this last comment, C and Java are
the languages being taught in the program I'm in at school. The program's
all about telecom and networking, and there seems to be as much, if not
more, UNIX operating on the server side of things as the Windows NT family,
so it'd make sense that they pick programming languages that are pretty much
cross platform. Since I have this bit, professional development application
at my disposal, though, I'm planning on taking a look at visual BASIC and C#
as well, just to see what they're all about, if nothing more.
| |
| Sylvain Lafontaine 2004-09-13, 3:59 pm |
| Excerpt if you are dealing with very old stuff, you will find that even in
the UNIX and telecom/networking environment C++ will be used instead of C.
Many so called "C" programs are in fact C++ programs.
S. L.
"Paul Fedorenko" <pfedorenko@look.ca> wrote in message
news:uJu50wUmEHA.952@TK2MSFTNGP14.phx.gbl...
>
> Thanks for the info you posted. As for this last comment, C and Java are
> the languages being taught in the program I'm in at school. The program's
> all about telecom and networking, and there seems to be as much, if not
> more, UNIX operating on the server side of things as the Windows NT
> family, so it'd make sense that they pick programming languages that are
> pretty much cross platform. Since I have this bit, professional
> development application at my disposal, though, I'm planning on taking a
> look at visual BASIC and C# as well, just to see what they're all about,
> if nothing more.
>
|
|
|
|
|