473,379 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

I need pointers


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.

--
There are Ogg Vorbis streams @
Virgin Radio
http://www.virginradio.co.uk/thestat...ten/index.html

Jul 21 '05 #1
10 1978
GTK#
"jbailo" <ja*****@earthlink.net> wrote in message
news:c6******************************@news.teranew s.com...

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.

--
There are Ogg Vorbis streams @
Virgin Radio
http://www.virginradio.co.uk/thestat...ten/index.html

Jul 21 '05 #2
On Sun, 26 Oct 2003 18:19:33 +0000, jbailo 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.


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, <tc******@mtco.com>
<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.

Jul 21 '05 #3
Then go back to yer C ya retard, wtf u doing here then. You whine more than
a well slapped biatch.
"Nucleon" <tc******@mtco.com> wrote in message
news:pa****************************@mtco.com...
On Sun, 26 Oct 2003 18:19:33 +0000, jbailo 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.
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, <tc******@mtco.com>
<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.

Jul 21 '05 #4
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
"Nucleon" <tc******@mtco.com> wrote in message
news:pa****************************@mtco.com...
On Sun, 26 Oct 2003 18:19:33 +0000, jbailo 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.
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, <tc******@mtco.com>
<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.

Jul 21 '05 #5
On Sun, 26 Oct 2003 22:47:28 +0100, in article
<ey*************@TK2MSFTNGP10.phx.gbl>, news.microsoft.com wrote:
Then go back to yer C ya retard, wtf u doing here then. You whine more than
a well slapped biatch.

"Nucleon" <tc******@mtco.com> wrote in message
news:pa****************************@mtco.com...


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%
Jul 21 '05 #6
["Followup-To:" header set to comp.os.linux.advocacy.]
On 2003-10-26, jbailo <ja*****@earthlink.net> 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.


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
Jul 21 '05 #7
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.

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"jbailo" <ja*****@earthlink.net> wrote in message
news:c6******************************@news.teranew s.com...

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.

--
There are Ogg Vorbis streams @
Virgin Radio
http://www.virginradio.co.uk/thestat...ten/index.html

Jul 21 '05 #8
In comp.os.linux.advocacy, jbailo
<ja*****@earthlink.net>
wrote
on Sun, 26 Oct 2003 18:19:33 GMT
<c6******************************@news.teranews.co m>:

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. :-) )

--
#191, ew****@earthlink.net
It's still legal to go .sigless.
Jul 21 '05 #9
In comp.os.linux.advocacy, news.microsoft.com
<an********@discussions.microsoft.com>
wrote
on Sun, 26 Oct 2003 22:48:22 +0100
<#H**************@TK2MSFTNGP09.phx.gbl>:
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. :-) )

"Nucleon" <tc******@mtco.com> wrote in message
news:pa****************************@mtco.com...
On Sun, 26 Oct 2003 18:19:33 +0000, jbailo 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.


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.
Some of this can be handled by using std::string, but C/C++ is
a lot uglier than it probably should be. :-)

--
Nucleon, <tc******@mtco.com>
<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.


--
#191, ew****@earthlink.net
It's still legal to go .sigless.
Jul 21 '05 #10
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.

--
Windows desktops and servers can find a safe haven on a
GNU/Linux/FreeBSD network!
Jul 21 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Tommy Lang | last post by:
I am working on this project and I need some help/pointers/comments to get me started, I am stuck. The program will be used to store information in an array while it is running. I need to store...
9
by: Simon | last post by:
Hi, if I have a structure like... struct sMyPointers{ ClassA *m_pPointerA; ClassB *m_pPointerB; void *m_pPointerToSomethingElse; };
0
by: rokuingh | last post by:
ok, so i've been working on this one for quite a while, and the code is very big so i'm just going to give the relevant parts. this is a program that builds polymers (chemical structures of repeated...
1
by: ArcInversion | last post by:
Hi, I've been using a javascript script to create a dragon that flies across the page. Anyways, I'd like to make it so when you click the dragon it takes you to a new page. Was wondering if anyone...
23
by: vinod.bhavnani | last post by:
Hello all, I need desperate help Here is the problem: My problem today is with multidimensional arrays. Lets say i have an array A this is a 4 dimensional static array.
11
by: sarathy | last post by:
Hi, I have been using C++ for a while. I am not entirely clear with the concepts of reference in C++. - Why was there a need for introducing a concept called "Reference" in C++ when everything...
5
by: Y2J | last post by:
I am working through this book on C++ programming, the author is speaking of using linked lists. He gave and example which I found confusing to say the least. So I rewrote the example in a way that...
20
by: Martin Jørgensen | last post by:
Hi, I'm reading a number of double values from a file. It's a 2D-array: 1 2 3 4 5 6 7 ------------- 1 3.2 2 0 2.1 3 9.3 4
7
by: DDP3000 | last post by:
void F(int **A, int N) { int i,j; for(i=0;i<N;i++) for(j=0;j<N;j++) A=((i+j)%2==0)?1:-1; } I have never used such a thing before, so it might be a really stupid question but I cannot find...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.