Dealing with source code

Discussion in 'C Programming' started by mistral, Oct 6, 2006.

  1. mistral

    mistral Guest

    How to deal with source code? What format need be source files to
    compile? I have source code on
    html pages, or in .txt format (this is assembler, not c, but there is
    no big difference, i think). What suitable editor to edit source code?
    Notepad? What format source need be saved? I need compile Nasm source
    into exe, parameters is:

    nasmw -s -fbin -o filename.s filename.asm

    should I run Nasm from MS-DOS window or from Run box?

    m.
     
    mistral, Oct 6, 2006
    #1
    1. Advertising

  2. mistral

    Cong Wang Guest

    On Oct 6, 4:45 pm, "mistral" <> wrote:
    > How to deal with source code? What format need be source files to
    > compile? I have source code on
    > html pages, or in .txt format (this is assembler, not c, but there is
    > no big difference, i think). What suitable editor to edit source code?
    > Notepad? What format source need be saved? I need compile Nasm source
    > into exe, parameters is:
    >
    > nasmw -s -fbin -o filename.s filename.asm
    >
    > should I run Nasm from MS-DOS window or from Run box?
    >
    > m.


    It's off topic here.
    It seems that you work in Microsoft Windows. You can, of course, run
    that command in a MS-DOS window.
    And you can edit the source code with UltraEdit.
     
    Cong Wang, Oct 6, 2006
    #2
    1. Advertising

  3. mistral

    Guest

    mistral wrote:

    > What suitable editor to edit source code?


    Zeus for Windows IDE: http://www.zeusedit.com

    Jussi Jumppanen
    Author: Zeus for Windows IDE
     
    , Oct 7, 2006
    #3
  4. mistral

    pete Guest

    mistral wrote:
    >
    > How to deal with source code? What format need be source files to
    > compile? I have source code on
    > html pages, or in .txt format (this is assembler, not c, but there is
    > no big difference, i think). What suitable editor to edit source code?
    > Notepad? What format source need be saved?


    C programs are made of text files.
    Some compilers expect the name of a C program file
    to end in .c, that's specifically a dot followed by a lower case c.
    There can also be other extensions on other filenames in a C program.

    --
    pete
     
    pete, Oct 7, 2006
    #4
  5. mistral

    mistral Guest

    pete пиÑал(а):

    mistral wrote:

    How to deal with source code? What format need be source files to
    compile? I have source code on html pages, or in .txt format (this is
    assembler, not c, but there is no big difference, i think). What
    suitable editor to edit source code? Notepad? What format source need
    be saved?

    > C programs are made of text files.
    > Some compilers expect the name of a C program file
    > to end in .c, that's specifically a dot followed by a lower case c.
    > There can also be other extensions on other filenames in a C program.


    > --
    > pete

    -------

    so, I just need save text file as with c extension, i.e. 'file.c'
    (since this file type isn't registered in system, windows will save it
    as file.c.txt) Same thing for nasm, i need save file as 'file.s'?

    m.
     
    mistral, Oct 7, 2006
    #5
  6. mistral

    pete Guest

    mistral wrote:
    >
    > pete пиÑал(а):
    >
    > mistral wrote:
    >
    > How to deal with source code? What format need be source files to
    > compile? I have source code on html pages, or in .txt format (this is
    > assembler, not c, but there is no big difference, i think). What
    > suitable editor to edit source code? Notepad? What format source need
    > be saved?
    >
    > > C programs are made of text files.
    > > Some compilers expect the name of a C program file
    > > to end in .c, that's specifically a dot followed by a lower case c.
    > > There can also be other extensions
    > > on other filenames in a C program.


    > so, I just need save text file as with c extension, i.e. 'file.c'
    > (since this file type isn't registered in system, windows will save it
    > as file.c.txt)


    That won't work if the compiler is looking for file.c
    You would need to find some way to end a file name with .c
    Maybe you can register the file type
    or maybe you can change the file name to file.c
    after the editor saves the file as something else.

    --
    pete
     
    pete, Oct 7, 2006
    #6
  7. In article <>,
    mistral <> wrote:

    >so, I just need save text file as with c extension, i.e. 'file.c'
    >(since this file type isn't registered in system, windows will save it
    >as file.c.txt)


    Recently in one of the newsgroups someone suggested putting "" around
    Windows filename to force Windows to accept it exactly as is.

    Also, if you have windows show you the file extensions then
    you can do a rename of the extension.
    --
    Prototypes are supertypes of their clones. -- maplesoft
     
    Walter Roberson, Oct 7, 2006
    #7
  8. mistral

    Guest

    mistral wrote:

    > (since this file type isn't registered in system, windows will
    > save it as file.c.txt)


    I suspect it is Notepad (or some other application) that is adding
    the .txt extension to the file. Not Windows itself.

    Jussi Jumppanen
    Zeus For Windows - "The ultimate programmer's editor/IDE"
    http://www.zeusedit.com
     
    , Oct 9, 2006
    #8
  9. writes:
    > mistral wrote:
    >> (since this file type isn't registered in system, windows will
    >> save it as file.c.txt)

    >
    > I suspect it is Notepad (or some other application) that is adding
    > the .txt extension to the file. Not Windows itself.


    <OT>
    Notepad doesn't add an extension if you specify a file name that
    already has one. If you tell it to save to foo.c it will save to
    foo.c . If you tell it to save to foo, it will save to foo.txt . If
    you tell it to save to "foo" (with the quotation marks), it will save
    to foo .

    I would expect other Windows text editors and other program to behave
    similarly.

    I wouldn't use Notepad to edit C code, but I don't do Windows
    programming, so I don't have an alternative to suggest.
    </OT>

    --
    Keith Thompson (The_Other_Keith) <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.
     
    Keith Thompson, Oct 9, 2006
    #9
  10. mistral

    Coos Haak Guest

    Op 8 Oct 2006 18:53:44 -0700 schreef :

    > mistral wrote:
    >
    >> (since this file type isn't registered in system, windows will
    >> save it as file.c.txt)

    >
    > I suspect it is Notepad (or some other application) that is adding
    > the .txt extension to the file. Not Windows itself.
    >
    > Jussi Jumppanen
    > Zeus For Windows - "The ultimate programmer's editor/IDE"
    > http://www.zeusedit.com


    <OT>
    No, it's really you, I'm sorry;-(
    Tell Windows to show extensions and it will only add the .txt extension if
    you didn't. If you tell it's file.c then it won't add a superfluous .txt.
    As simple as that ;-)
    </OT>
    --
    Coos
     
    Coos Haak, Oct 9, 2006
    #10
  11. Coos Haak <> writes:
    > Op 8 Oct 2006 18:53:44 -0700 schreef :
    >> mistral wrote:
    >>
    >>> (since this file type isn't registered in system, windows will
    >>> save it as file.c.txt)

    >>
    >> I suspect it is Notepad (or some other application) that is adding
    >> the .txt extension to the file. Not Windows itself.

    >
    > <OT>
    > No, it's really you, I'm sorry;-(
    > Tell Windows to show extensions and it will only add the .txt extension if
    > you didn't. If you tell it's file.c then it won't add a superfluous .txt.
    > As simple as that ;-)


    Doesn't it do exactly the same thing whether you tell it to show
    extensions or not?

    I suspect the OP observed that Windows adds a ".txt" extension if
    there's no '.' in the specified file name, and incorrectly assumed
    that it would do so if there is a '.' in the specified file name.

    > </OT>


    --
    Keith Thompson (The_Other_Keith) <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.
     
    Keith Thompson, Oct 9, 2006
    #11
  12. mistral

    mistral Guest

    Keith Thompson wrote:

    > Coos Haak <> writes:
    > > Op 8 Oct 2006 18:53:44 -0700 schreef :
    > >> mistral wrote:


    > (since this file type isn't registered in system, windows will
    > save it as file.c.txt)
    >
    > I suspect it is Notepad (or some other application) that is adding
    > the .txt extension to the file. Not Windows itself.


    > <OT>
    > No, it's really you, I'm sorry;-(
    > Tell Windows to show extensions and it will only add the .txt extension if
    > you didn't. If you tell it's file.c then it won't add a superfluous .txt.
    > As simple as that ;-)


    > Doesn't it do exactly the same thing whether you tell it to show
    > extensions or not?


    > I suspect the OP observed that Windows adds a ".txt" extension if
    > there's no '.' in the specified file name, and incorrectly assumed
    > that it would do so if there is a '.' in the specified file name.


    > </OT>


    ----------------------------

    Just tried to test the issue again, windows provides c file:

    File name: test.c
    Save as type: Text Documents(*.txt)
    Encoding: UTF-8

    This c file have a text doc icon, though.

    If selected option in 'Save as type' is 'All Files', this does not
    affect on file type (importand when create html files). So probably
    Save as type: Text Documents(*.txt) need be used.

    m.
     
    mistral, Oct 11, 2006
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jesse
    Replies:
    2
    Views:
    325
  2. Author Tarun Tyagi
    Replies:
    0
    Views:
    718
    Author Tarun Tyagi
    Dec 29, 2004
  3. Eric Lilja

    Robustify code dealing with input

    Eric Lilja, Jun 4, 2005, in forum: C Programming
    Replies:
    13
    Views:
    549
    Keith Thompson
    Jun 5, 2005
  4. Jens-Oliver Murer
    Replies:
    1
    Views:
    463
    Jens-Oliver Murer
    Oct 17, 2008
  5. Jenny
    Replies:
    3
    Views:
    265
    Dag Sunde
    Dec 17, 2004
Loading...

Share This Page