Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Advice on an approach to a problem

Reply
Thread Tools

Advice on an approach to a problem

 
 
Pinnerite
Guest
Posts: n/a
 
      05-16-2013
I make great use of a 'C' program written by someone else. It works
invisibly but creates files named by itself. I would like to grant the user
the option to create their own filenames and the paths for the created
files.

My question is in which environment to tackle this: C or C++?
I have not programmed for some time but keep up to date as best I can. I
have a limited experience in using OO languages but I do not want to devote
myself into becoming an expert in either language just getting to grips with
the bits that I need for this exercise.

I should add that this is a Linux exercise.

Any suggestions? TIA

--
__________________________________________________ _

Mageia 2 for x86_64, Kernel: 3.4.34-desktop-1.mga2
KDE version 4.8.5 Running on an AMD 4-core processor

 
Reply With Quote
 
 
 
 
Jorgen Grahn
Guest
Posts: n/a
 
      05-16-2013
On Thu, 2013-05-16, Pinnerite wrote:
> I make great use of a 'C' program written by someone else. It works
> invisibly but creates files named by itself. I would like to grant the user
> the option to create their own filenames and the paths for the created
> files.


Careful with the terminology. "path" and "filename" are almost
synonyms.

Programs (in Unix) which hardcode the output paths do indeed suck.
There are a few better design choices, assuming the program needs to
generate more than one file:

% foo # creates files in current directory
% foo --src bar.c --hdr bar.h
# the number of files is small and known
% foo --dest /tmp/bar/
# create /tmp/bar/ if needed and leave any files there
% foo --prefix /tmp/bar
# files are called bar.01, bar.02, ...

And others. You don't say what the program does, and it's hard to guess.

> My question is in which environment to tackle this: C or C++?


C, of course. Why would you add an extra work load by porting it to
C++? It's not as if C cannot write to files.

Followup set.

> I have not programmed for some time but keep up to date as best I can. I
> have a limited experience in using OO languages but I do not want to devote
> myself into becoming an expert in either language just getting to grips with
> the bits that I need for this exercise.


You don't need to learn OO for this.

> I should add that this is a Linux exercise.


/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need design advice. What's my best approach for storing this data? Mudcat Python 9 03-21-2006 06:26 AM
Advice on best approach =?Utf-8?B?TWFubnk=?= ASP .Net 2 12-23-2004 04:03 AM
advice needed - what approach for sql access KavvY ASP .Net 1 07-17-2004 08:17 AM
Advice on design approach (please!) Erik J Sawyer ASP .Net Building Controls 2 09-07-2003 05:01 AM
Advice on design approach and principles Mr Gordonz ASP .Net 1 08-04-2003 10:08 PM



Advertisments