www.digitalmars.com         C & C++   DMDScript  

c++ - Help

reply gp <gp_member pathlink.com> writes:
I have a text file with my C++ code in it.  Bearing in mind I know absolutely
nothing about any of this, could someone tell me how to get that into a program
with the compiler?  I am using the Digital Mars Compiler.  
Feb 09 2004
parent reply "Phill" <phill pacific.net.au> writes:
1:
Open a command prompt

2:
Change to the directory where you code is, ie:

cd c:\windows\desktop

3:
compile your file ie:

dmc yourfile.cpp

If it compiles you should see a yourfile.exe file in the same directory as
your source code.

4:
If you dont have any errors, you can run your file
by typing its name at the command prompt ie:

yourfile

--------------------------
If you do have errors you will have to correct the code and then repeat step
3.

Phill.

"gp" <gp_member pathlink.com> wrote in message
news:c08v06$18cn$1 digitaldaemon.com...
 I have a text file with my C++ code in it.  Bearing in mind I know
absolutely
 nothing about any of this, could someone tell me how to get that into a
program
 with the compiler?  I am using the Digital Mars Compiler.
Feb 10 2004
parent reply gp <gp_member pathlink.com> writes:
OK, few questions (I did say I knew nothing)  HOw do I open a command prompt?
what do I type in if my compiler is in 
C:\dm\bin\dmc   (dmc is not a directory, it is the filename

and the file is in
C:\dm\bin\prog1.txt

Thanks
In article <c0a7us$b5m$1 digitaldaemon.com>, Phill says...
1:
Open a command prompt

2:
Change to the directory where you code is, ie:

cd c:\windows\desktop

3:
compile your file ie:

dmc yourfile.cpp

If it compiles you should see a yourfile.exe file in the same directory as
your source code.

4:
If you dont have any errors, you can run your file
by typing its name at the command prompt ie:

yourfile

--------------------------
If you do have errors you will have to correct the code and then repeat step
3.

Phill.

"gp" <gp_member pathlink.com> wrote in message
news:c08v06$18cn$1 digitaldaemon.com...
 I have a text file with my C++ code in it.  Bearing in mind I know
absolutely
 nothing about any of this, could someone tell me how to get that into a
program
 with the compiler?  I am using the Digital Mars Compiler.
Feb 11 2004
parent "Phill" <phill pacific.net.au> writes:
I dont know what your code  file contains but all I can say is your code
file will have to have a .cpp extension, .txt will not compile.
It would have to be "prog1.cpp" for C++ files. Maybe it is simply a case of
renaming your file.

In case your file isnt a workable one, I have attached a simple file that
will work.

The command prompt is somewhere on your start menu.

Or
you can go to the
start-> run
and type
cmd
that should bring up the command window.

if dmc is on your PATH you can just simply type:
------------------------------
cd c:\dm\bin
press enter
Then type
dmc test.cpp
press enter
-----------------------------------

To run the exe file you can type:

test

Having said all of that, one thing I would suggest is that you take the code
that you write and put it in its
own directory. Then you would have to cd to that directory ie;

cd c:\MyPrograms

After you get "dmc" running,maybe you should do a search for some tutorials
on the internet.

I can tell you that you would learn faster and much easier if you bought the
Digital Mars CD, It
has a Help menu that has all of the functions and types for you to look up.
Also some good tutorials
come with it. And heaps more.....

Good luck
         Phill


"gp" <gp_member pathlink.com> wrote in message
news:c0dtni$d81$1 digitaldaemon.com...
 OK, few questions (I did say I knew nothing)  HOw do I open a command
prompt?
 what do I type in if my compiler is in
 C:\dm\bin\dmc   (dmc is not a directory, it is the filename

 and the file is in
 C:\dm\bin\prog1.txt

 Thanks
 In article <c0a7us$b5m$1 digitaldaemon.com>, Phill says...
1:
Open a command prompt

2:
Change to the directory where you code is, ie:

cd c:\windows\desktop

3:
compile your file ie:

dmc yourfile.cpp

If it compiles you should see a yourfile.exe file in the same directory
as
your source code.

4:
If you dont have any errors, you can run your file
by typing its name at the command prompt ie:

yourfile

--------------------------
If you do have errors you will have to correct the code and then repeat
step
3.

Phill.

"gp" <gp_member pathlink.com> wrote in message
news:c08v06$18cn$1 digitaldaemon.com...
 I have a text file with my C++ code in it.  Bearing in mind I know
absolutely
 nothing about any of this, could someone tell me how to get that into a
program
 with the compiler?  I am using the Digital Mars Compiler.
begin 666 test.cpp ` end
Feb 11 2004