Connecting Tech Pros Worldwide Help | Site Map

AdrianH AdrianH is offline

Expert

Visitor Messages

Showing Visitor Messages 1 to 2 of 2
  1. Nsandy
    i have to create a text editor using c.
    n i want when the program runs a new file is opened.
    what should to do so?

    i have tried this..


    #include<stdio.h>
    #include<conio.h>
    void main()
    clrscr();
    FILE *fp;
    fp=fopen("untitled.txt",' w ');
    char line[80];
    scanf("%[^/n]",line);
    }
  2. india215
    how do I save ping results in a text file via c++?
    Below is a copy of my code.
    hrping here is an external program that works in a similiar manner as ping.

    Any advice will be greatly appreciated.



    #include <iostream>
    #include <string>
    #include <windows.h>

    using namespace std;

    static string host;
    static string ping_again;

    void ping()
    {
    int j,ep,k,ep1;
    char wait1;
    j=2;
    k=2;

    cout << "Host: ";
    cin >> host;

    for(ep=0;ep<j;ep++)
    {

    for(ep1=0;ep1<k;ep1++)
    {
    system (("c:\\hrping-v238\\hrping.exe " + host).c_str());


    cout << endl;
    }

    }
    cout<< "wait";
    cin>>wait1;
    }

    int main()
    {
    SetConsoleTitle("Ping in C++ by PVAMU");
    ping();

    return(0);
    }

About Me

  • About AdrianH
    Biography
    I'm a computer programme designer/developer who likes doing research.
    Location
    Halifax
    Interests
    Cycling, researching ideas, martial arts
    Occupation
    developer/designer

Statistics

Total Posts
Visitor Messages
General Information
  • Last Activity: Dec 29 '07
  • Join Date: Feb 4 '07