Git Product home page Git Product logo

c-lab-1-ex-2's Introduction

A C program is run with 4 parameters on the command line:

string1 file1 string2 file2

where file1 and file2 are file names and string1 and string2 are C strings.

It makes a copy of the content of file1 (input file) in file2 (output file) substituting each sequence of characters equal to string1 with string2.

##Notice that:

  • file1 contains an unknown number of rows, but each row is at most of length equal to 100 characters
  • string1, string2 and all C strings in file1 have a maximum length equal to 20 characters
  • string1 and string2 are proper C strings, i.e., they to not contain spaces, tabs, etc.

##Example Let us suppose to run the program with the following parameters:

test file1.txt check file2.txt

and that file1.txt is the following:

####Regression file.

This file is to test the program.

In the previous line we should have a substitution (testWITHcheck).

Here we should not have it: t-e-s-t.

The following file2.txt has to be generated:

####Regression file.

This file is to check the program.

In the previous line we should have a substitution (checkWITHcheck).

Here we should not have it: t-e-s-t.

Suggestion Use the program to substitute a sub-string within a string

as a subprogram.

c-lab-1-ex-2's People

Contributors

foysalit avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.