I need pointers

  • Thread starter Thread starter jbailo
  • Start date Start date
J

jbailo

I've been working on my
gcc/Gtk+ application and
realized how much I need
pointers. String manipulation
in c is so beautiful and
elegant and fast -- its
way above all the dum-dum
'methods' of semi-script
languages such as c#.

'safe code' is not code in
the same way that Equal is
not sugar and diet soda is
not soda.
 
I've been working on my
gcc/Gtk+ application and
realized how much I need
pointers. String manipulation
in c is so beautiful and
elegant and fast -- its
way above all the dum-dum
'methods' of semi-script
languages such as c#.

'safe code' is not code in
the same way that Equal is
not sugar and diet soda is
not soda.

Frankly, I hate working with strings in C. The main reason is that I
don't like putting arbitrary limits on the length of string I'll accept,
and keeping those limits throughout. The alternative is to dynamically
allocate. And that sucks too, because as you pass strings around, you
have to remember who can delete them. C++ strings, or scripting language
strings, are better.

--
Nucleon, <[email protected]>
<http://vlevel.sourceforge.net> - Stop fiddling with the volume knob.

If nature has made any one thing less susceptible than all others of exclusive
property, it is the action of the thinking power called an idea.
 
Then go back to yer C ya retard, wtf u doing here then. You whine more than
a well slapped biatch.
 
since when is C# script? Last i checked it was a compiled language.
¨
Maybe you need to go back to school, I guess you think London is a country
also. Damn uneducated reatard
 
Then go back to yer C ya retard, wtf u doing here then. You whine more than
a well slapped biatch.

news:p[email protected]...

Let's review our checklist, shall we?

[ X ] Microsoft Outlook Express user
[ X ] Anonymous news.microsoft.com user
[ X ] Cross-poster
[ X ] Top-poster
[ X ] Ignorance of sentence structure, spelling, and grammar
[ X ] Juvenile geek-speak

Bonehead Rating: 100%
 
["Followup-To:" header set to comp.os.linux.advocacy.]
I've been working on my
gcc/Gtk+ application and
realized how much I need
pointers. String manipulation
in c is so beautiful and
elegant and fast -- its
way above all the dum-dum
'methods' of semi-script
languages such as c#.

'safe code' is not code in
the same way that Equal is
not sugar and diet soda is
not soda.

Hey,

Bailo - how many times to I have to point out to you that C# does have
pointers. Are you stupid or what? Topics to look at in the help -
unsafe, fixed, sizeof, etc.

Tom Shelton
 
If you really think that you need to target the addressing mechanism of the
machine, then use unsafe code. The idea of insulating the developer from
this low level tedium is because working at that level requires care with
the manual labor so that things always work right. Unsafe code will expose
the pointers that you love.
 
In comp.os.linux.advocacy, jbailo
<[email protected]>
wrote
I've been working on my
gcc/Gtk+ application and
realized how much I need
pointers. String manipulation
in c is so beautiful and
elegant and fast -- its
way above all the dum-dum
'methods' of semi-script
languages such as c#.

'safe code' is not code in
the same way that Equal is
not sugar and diet soda is
not soda.

String manipulation in C/C++ is many things, but "elegant"
is not the first word that comes to mind.

std::string is livable, though, although it does not
have Java's immutability (unless one declares const std::string).
But it has the usual stuff: ordering, operator[], concatenation,
single- and multi-character search.

But delve down into char * and that's where the troubles start.
To be sure, char * allows many tricks; the code sequence:

char * p = "My name is Dave";
char * name = p + 11;
strcpy(name, "Alan");
printf("%s\n", p);

will probably print out the line "My name is Alan" on many systems,
though it's possible gcc's default options preclude such modifications.
(If such is the case, one will get a memory error of some sort.)

If one uses

strcpy(name, "Dilbert");

things get ugly quickly; the best case scenario is that the
first two characters of string following get clobbered with "rt".
The line printed out in that case might be something like:

My name is Dilbertt that's not important right now.

if one is optimistic enough. (If not, one gets fairly bad garbage.)

C# has unsafe pointer manipulation, if one really wants it. (I
don't know the details.) Java has it, too, if one uses JNI.
(Not many people do. :-) )
 
In comp.os.linux.advocacy, news.microsoft.com
<[email protected]>
wrote
since when is C# script? Last i checked it was a compiled language.

Twice, in fact: once to intermediate code level, once to final
machine code level.
¨
Maybe you need to go back to school, I guess you think London is a country
also. Damn uneducated reatard

London is in its own little world. :-) (Then again, so is San Francisco. :-) )

Some of this can be handled by using std::string, but C/C++ is
a lot uglier than it probably should be. :-)
 
While restarting Outlook, The Ghost In The Machine grumbled:
String manipulation in C/C++ is many things, but "elegant"
is not the first word that comes to mind.

It is actually pretty good if you use the string class and the
algorithms.

As good as BASIC (Commodore/Microsoft) was, and maybe better.

However, a good programmer can use both std::string and the strxxx()
functions.
 
Back
Top