www.digitalmars.com         C & C++   DMDScript  

c++ - Mixed "C"-gnals

reply "Aurura" <aurura ev1.net> writes:
I actually found a tutorial for the absolute beginner in C and C++ online.
While I understand that I still need to get a book, I was still delighted to
find more online enlightenment.

So, of course, comes my next questions:

All the program exercises for these tutorials have (obviously) a ".c" extension.
Will this be compatible with the DigitalMars compiler?

Will I need to rename them to '.cpp' before I can use any of them?  or will that
corrupt the file or compiler?

Me (again)
Sep 17 2002
next sibling parent user domain.invalid writes:
No you don't have to rename them. As long as C++ sources are in 
*.cpp files and c sources are in *.c files.

The compiler is a C and C++ compiler.

Aurura wrote:
 I actually found a tutorial for the absolute beginner in C and C++ online.
 While I understand that I still need to get a book, I was still delighted to
 find more online enlightenment.
 
 So, of course, comes my next questions:
 
 All the program exercises for these tutorials have (obviously) a ".c"
extension.
 Will this be compatible with the DigitalMars compiler?
 
 Will I need to rename them to '.cpp' before I can use any of them?  or will
that
 corrupt the file or compiler?
 
 Me (again)
 
 
Sep 17 2002
prev sibling parent reply "Aurura" <aurura ev1.net> writes:
the '.c' files I have were originally in a folder called 'CTutorial'.

I had to move a '.c'  into DigitalMars' bin file in order for it to link and
compile.  Though I'm satisfied with the result, I'd like to ask if all of the .c
or .cpp files I ever use or create will have to be saved in DigitalMars' bin
file in order to work?

Me
Sep 17 2002
parent reply user domain.invalid writes:
Aurura wrote:
 the '.c' files I have were originally in a folder called 'CTutorial'.
 
 I had to move a '.c'  into DigitalMars' bin file in order for it to link and
 compile.  Though I'm satisfied with the result, I'd like to ask if all of the
.c
 or .cpp files I ever use or create will have to be saved in DigitalMars' bin
 file in order to work?
 
 Me
 
 
No you don't have to move those *.c and *.cpp files to the bin folder. You have make sure the the bin dir is in the search path.
Sep 18 2002
parent reply "Aurura" <aurura ev1.net> writes:
...exactly how do I do that?
Sep 18 2002
parent reply bw <bw_member pathlink.com> writes:
In article <amad0k$2b9d$1 digitaldaemon.com>, Aurura says...
...exactly how do I do that?
lot's of ways to skin a cat, sorry if this is too much information. from a prompt... set path=c:\etc\etc\dm\bin;%PATH% -or- you can add c:\etc\dm\bin to your autoexec.bat PATH= statement if you have one. that way you don't have to reset it every time you open a new window. -or- you could create a sc.bat file and stick it in your windows\command folder, something like... rem sc.bat echo off c:\etc\etc\dm\bin\sc.exe %1 %2 %3 %4 %5 rem end sc.bat -or- you could create a dmvars.bat i've been using this... rem dmvars.bat echo off if "%1"=="OFF" goto remove if "%1"=="off" goto remove subst s: c:\cpp\dm set path=s:\bin;c:\windows;c:\windows\command;c:\xdos; set INCLUDE= set LIB= echo DMC++ variables set goto end :remove c: subst s: /d set path=c:\windows;c:\windows\command;c:\xdos; echo DMC++ variables removed goto end :end rem end dmvars.bat
Sep 18 2002
parent reply "Aurura" <aurura ev1.net> writes:
...I tried your first example in five different ways.

Here's how I tried them:

1.  set path=c:\DigMars\dm\bin,%PATH%
   Too many parameters

2.  set path=c:\DigMars\dm\bin
   (Took me back to the original prompt)

3. set path=c:\DigMars\dm\bin,compiler
   Too many parameters

4.set path=c:\DigMars\dm\bin, compiler
   Too many parameters

5.set path=c:\DigMars\dm\bin,%compiler%
  Syntax error

As you can see, I have no idea what I'm doing.
I'll keep trying.  Any additional assistance would be absolutely wonderful.

Me
Sep 18 2002
next sibling parent "Aurura" <aurura ev1.net> writes:
okay, so I used a semi colon instead.  now, I type in path, and I get:

PATH=C:\DIGMARS\DM\BIN;C:\DIGMARS\DM\BIN;COMPILER

um... was this supposed to happen this way?

feeling sheepish,

Me
Sep 18 2002
prev sibling parent Michael Comperchio <mcmprch adelphia.net> writes:
Aurura wrote:
 ...I tried your first example in five different ways.
 
 Here's how I tried them:
 
 1.  set path=c:\DigMars\dm\bin,%PATH%
    Too many parameters
 
 2.  set path=c:\DigMars\dm\bin
    (Took me back to the original prompt)
 
 3. set path=c:\DigMars\dm\bin,compiler
    Too many parameters
 
 4.set path=c:\DigMars\dm\bin, compiler
    Too many parameters
 
 5.set path=c:\DigMars\dm\bin,%compiler%
   Syntax error
 
 As you can see, I have no idea what I'm doing.
 I'll keep trying.  Any additional assistance would be absolutely wonderful.
 
 Me
 
 
you need dot-commas (;) not commas....
Sep 18 2002