Purchase Solution

File Transferring in Visual C++

Not what you're looking for?

Ask Custom Question

Visual C++
Write a program that takes a command line argument that is the name of a text file and creates a new file with a heading line
***************** file name ********************
and the contents of the original file with line numbers added. If the file's name contains a period, use the part of the name before the period concatenated with .lis as the name of the new file. Otherwise, just concatenate .lis with the whole file name.

Purchase this Solution

Solution Summary

A Visual C++ program is written to transfer an old file to a new file.

Solution Preview

See also the attached file.
====================
// file_name.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <string.h>
#include <memory.h>
#include <conio.h>

static const int NAME_MAX = 255 ;
static const int MAX_LINE = 255 ;

void create_file_name(char* pfn, char* pn) ;
int create_new_file (char* p_old, char* p_name) ;

int main(int argc, char* argv[])
{
int n = argc;

if (argc < 2)
{
printf ("Command line argument was not given! Try again.") ;
return ...

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.