Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jan 2003
    Location
    philippines
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    text editor in dos in TC

    how can i create a text editor in dos in turbo C, i have tryied it to this

    #include<stdio.h>

    main(int argc, char *argv[] ){
    FILE *fp;
    char ch;

    if( argc != 2 ) {

    printf("you forgot to enter the filename\n");
    return 1;
    }

    if( ( fp = fopen( argv[1],"w")) == NULL ) {

    printf("cannot file\n");
    return 1;

    }

    do{
    ch = getchar();

    putc( ch, fp );

    } while(ch != '$');

    fclose(fp);
    return 0;
    }

    but it wont satisfy me becase when i press enter i wont get back to the first characters that i have type on the screen. i want to have a dos Text editor like notepad. I am using Turbo C version 2.0, please help me


    thanks
    Let's help each other

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Later versions of DOS (5.0?) have a program called EDIT.COM which does that already.

  • #3
    New Coder
    Join Date
    Jan 2003
    Location
    philippines
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ic but i want to create my own in Turboc C

    ic but i want to create my own in Turboc C, is it posible
    Let's help each other

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes, it's possible. It's going to take a heck of a lot more code than you've got so far though, you'll need to do a lot more than just copy the text file to the screen which is all your code does so far.

  • #5
    New Coder
    Join Date
    Jan 2003
    Location
    philippines
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    i want to try it, what was the header files needed to create it

    i want to try it just for practice, what was the header files needed to create it.
    Let's help each other

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The header files needed? It depends, are you planning on using some windowing library? Then obviously you'll need the header files for that library. It might look simple but an editor can be a very complex bit of code.

  • #7
    New Coder
    Join Date
    Jan 2003
    Location
    philippines
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    a edit.com version in windows 98, some like that kind of text editor

    a edit.com version in windows 98, some like that kind of text editor.
    Let's help each other


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •