C- Advice

C

Cmorriskuerten

HI,

I learned C by reading a book (C in 21 days, Sams), no I just want to go on.
Some people gave me the advice to write a program like a text- editor, is that
a good desicion?

Thanks in advance,

Christopher
 
M

Mark A. Odell

(e-mail address removed) (Cmorriskuerten) wrote in

HI,

I learned C by reading a book (C in 21 days, Sams), no I just want to go
on. Some people gave me the advice to write a program like a text-
editor, is that a good desicion?

No. Write a file conversion utility or some sort of text parser.
 
A

Aggro

Cmorriskuerten said:
HI,

I learned C by reading a book (C in 21 days, Sams), no I just want to go on.
Some people gave me the advice to write a program like a text- editor, is that
a good desicion?

I would recommend you to write a program of your like. If you think it
would be cool to make a text editor of your own, then go for it ;)

I personally enjoy making games. I have made a game almost with every
language I have learned. I think it makes learning fun. And when it is
fun to learn, you usually learn better.
 
B

Bruno Desthuilliers

Cmorriskuerten said:
HI,

I learned C by reading a book (C in 21 days, Sams),
Err...

no I just want to go on.
Some people gave me the advice to write a program like a text- editor, is that
a good desicion?

If I were you, I'd start by trying to make all the exercises in the K&R2.

Bruno
 
M

Malcolm

Cmorriskuerten said:
I learned C by reading a book (C in 21 days, Sams), no I just want to > go on.
Some people gave me the advice to write a program like a text- editor, > is that a good desicion?
Learning the syntax of a language and its support functions is generally the
easy part. You then need to practise by writing real programs.

The choice of what program to write depends on the platform, your interests,
and your level of skill. For instance a simple text editor on a
character-mapped system, where you provided with a function like printat(x,
y, ch) for writing to the screen, would be quite easy to write. Trying to do
the same thing under Windows would be a much taller order.

Generally I think that graphical programs are best because you get an
immediate visual fix on any errors. However this does mean learning
something beyond the C run-time library.
 
C

Cmorriskuerten

No. Write a file conversion utility or some sort of text parser.
What do u mean by a conversion utility, a programm that converts files in
different types of files?
 
M

Mark A. Odell

(e-mail address removed) (Cmorriskuerten) wrote in

What do u mean by a conversion utility, a programm that converts files
in different types of files?

Yes. Convert a .jpg to .gif or something like that.

Or, far simpler, write a text parser that generates a bunch of #defines,
enums, and characters strings from a list file, e.g.

// Input, apple.str, file to my new stringer program.
[elements]
foo
bar
baz
fub

[enum]
1 // Want enum version of 'elements'
bubs

[define]
0 // Don't want #define versions

[string]
1 // Want strings
bubStrings

// EOF


usage: stringer apple.str -o apple.h

output:
// apple.h
enum bubs
{
foo,
bar,
baz,
fub
};

const char *bubStrings[] =
{
"foo",
"bar",
"baz",
"fub"
};
 

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
474,079
Messages
2,570,574
Members
47,206
Latest member
Zenden

Latest Threads

Top