Extending a C program

P

Pinnerite

There is a 'C' program that I use extensively but it lacks a couple of
things. One is to tell it to name a file and the other where to put it.
This needs a GUI drop-down and a dialog box.

My question is should I look for a C or a C++ library that can provide the
functionality? Suggestions for libraries would be very welcome.
 
C

Chicken McNuggets

There is a 'C' program that I use extensively but it lacks a couple of
things. One is to tell it to name a file and the other where to put it.
This needs a GUI drop-down and a dialog box.

My question is should I look for a C or a C++ library that can provide the
functionality? Suggestions for libraries would be very welcome.

Use whichever you are most comfortable with, although since it is
already written in C you'll probably find it easier to continue working
in C.

C programs often use C++ keywords for variable names which causes issues
when trying to compile them with a C++ compiler.

I'd suggest GTK+ for the GUI since it has both C and C++ bindings so you
can choose which one you want to use. If you decide to use C++ then Qt
is pretty hard to beat.
 
P

Pinnerite

Chicken said:
Use whichever you are most comfortable with, although since it is
already written in C you'll probably find it easier to continue working
in C.

C programs often use C++ keywords for variable names which causes issues
when trying to compile them with a C++ compiler.

I'd suggest GTK+ for the GUI since it has both C and C++ bindings so you
can choose which one you want to use. If you decide to use C++ then Qt
is pretty hard to beat.

Thanks, Alan
 
J

Jorgen Grahn

There is a 'C' program that I use extensively but it lacks a couple of
things. One is to tell it to name a file and the other where to put it.
This needs a GUI drop-down and a dialog box.

My question is should I look for a C or a C++ library that can provide the
functionality? Suggestions for libraries would be very welcome.

Way too little information. E.g.
- does it have a GUI already?
- how does the need to "name a file" translate into a need for
"a GUI drop-down and a dialog box"? Lots of programs can do it
without either.
- how is this presumably existing file named today?

/Jorgen
 
P

Pinnerite

Jorgen said:
Way too little information. E.g.
- does it have a GUI already?
No.

- how does the need to "name a file" translate into a need for
"a GUI drop-down and a dialog box"? Lots of programs can do it
without either.

I want to mimic the way that Windows does it to encourage refugees.
- how is this presumably existing file named today?

Files receive a randomly created name and are placed in a 'hard-wired'
directory.
 
J

Jorgen Grahn

I want to mimic the way that Windows does it to encourage refugees.

That can be right in some circumstances, but in others you'll (a)
create a ghetto for the refugees and (b) offend the natives. It's
usually IMO better to look at what's normal in the environment you're
using, whatever it is.

If it's command-line Unix I'd expect to get the result as text on
std::cout, and/or be able to provide the filename using an '-o'
command-line option. See Eric Raymond's book (online).

Anyway, all this is offtopic, so I should probably stop there.

/Jorgen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top