By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,852 Members | 2,240 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,852 IT Pros & Developers. It's quick & easy.

Segmentation Fault (core dumped)

P: n/a
I wrote this small program to reverse each word in the string. For
example: "I love You" should print as "I evoL uoY". I get Segmentation
Fault (core dumped) error upon running the program. It compiles fine.

// Program to reverse each word in the string
#include<stdio.h>

int main()
{
void reverse_string(char *, int, int);
char *p = "my name is daniel";
// keeps count of number is char in the word to reverse
int count = 0;
// keeps track of where I started this current word from
int current_pos = 0;
// Conitnue till you reach \0
while(1){
if (*p == '\0') break;
count = 0;
while(*p != ' '){
if (*p == '\0') break;
count++;
p++;
}
reverse_string(p, current_pos, count);
if (*p == ' '){
p++;
count++;
current_pos = count;
}
}
puts(p);
return 0;
}

void reverse_string(char* s, int start, int count){
int counter = count/2;
int i = 0;
while(i < counter){
*s = *(s-count);
s--;
i++;
}
}
Any suggestions......Every help is appreciated.

Thanks

Feb 18 '07 #1
Share this Question
Share on Google+
29 Replies


P: n/a
DanielJohnson wrote:
// Program to reverse each word in the string
#include<stdio.h>

int main()
{
void reverse_string(char *, int, int);
char *p = "my name is daniel";
// keeps count of number is char in the word to reverse
int count = 0;
// keeps track of where I started this current word from
int current_pos = 0;
// Conitnue till you reach \0
while(1){
if (*p == '\0') break;
You correctly note that you want to continue until reaching the null
character in the string.

However you do not have a null character in your string.
Try :
char *p = "my name is daniel\0";

--
Zack
Feb 18 '07 #2

P: n/a
>I wrote this small program to reverse each word in the string. For
>example: "I love You" should print as "I evoL uoY". I get Segmentation
Fault (core dumped) error upon running the program. It compiles fine.
You stored the test string in a quoted string literal. C is permitted
to store such data in a read-only section of the program. If you
try writing on it, KABOOM!

Note also that you keep incrementing p, losing track of where the
beginning of the string is. That's not good when you try to print it.
>
// Program to reverse each word in the string
#include<stdio.h>

int main()
{
void reverse_string(char *, int, int);
char *p = "my name is daniel";
// keeps count of number is char in the word to reverse
int count = 0;
// keeps track of where I started this current word from
int current_pos = 0;
// Conitnue till you reach \0
while(1){
if (*p == '\0') break;
count = 0;
while(*p != ' '){
if (*p == '\0') break;
count++;
p++;
}
reverse_string(p, current_pos, count);
if (*p == ' '){
p++;
count++;
current_pos = count;
}
}
puts(p);
return 0;
}

void reverse_string(char* s, int start, int count){
int counter = count/2;
int i = 0;
while(i < counter){
*s = *(s-count);
s--;
i++;
}
}
Any suggestions......Every help is appreciated.

Thanks

Feb 18 '07 #3

P: n/a
On Feb 18, 12:29 am, Zack <goldszs...@gmail.comwrote:
DanielJohnson wrote:
// Program to reverse each word in the string
#include<stdio.h>
int main()
{
void reverse_string(char *, int, int);
char *p = "my name is daniel";
// keeps count of number is char in the word to reverse
int count = 0;
// keeps track of where I started this current word from
int current_pos = 0;
// Conitnue till you reach \0
while(1){
if (*p == '\0') break;

You correctly note that you want to continue until reaching the null
character in the string.

However you do not have a null character in your string.
Try :
char *p = "my name is daniel\0";

--
Zack
I still get the same error even after putting in \0.

Feb 18 '07 #4

P: n/a
On Feb 18, 12:31 am, gordonb.x6...@burditt.org (Gordon Burditt) wrote:
I wrote this small program to reverse each word in the string. For
example: "I love You" should print as "I evoL uoY". I get Segmentation
Fault (core dumped) error upon running the program. It compiles fine.

You stored the test string in a quoted string literal. C is permitted
to store such data in a read-only section of the program. If you
try writing on it, KABOOM!

Note also that you keep incrementing p, losing track of where the
beginning of the string is. That's not good when you try to print it.
// Program to reverse each word in the string
#include<stdio.h>
int main()
{
void reverse_string(char *, int, int);
char *p = "my name is daniel";
// keeps count of number is char in the word to reverse
int count = 0;
// keeps track of where I started this current word from
int current_pos = 0;
// Conitnue till you reach \0
while(1){
if (*p == '\0') break;
count = 0;
while(*p != ' '){
if (*p == '\0') break;
count++;
p++;
}
reverse_string(p, current_pos, count);
if (*p == ' '){
p++;
count++;
current_pos = count;
}
}
puts(p);
return 0;
}
void reverse_string(char* s, int start, int count){
int counter = count/2;
int i = 0;
while(i < counter){
*s = *(s-count);
s--;
i++;
}
}
Any suggestions......Every help is appreciated.
Thanks
What should I do prevent KABOOM...I am newbie..give me some tips...

Feb 18 '07 #5

P: n/a
>// Program to reverse each word in the string
>#include<stdio.h>

int main()
{
void reverse_string(char *, int, int);
char *p = "my name is daniel";
// keeps count of number is char in the word to reverse
int count = 0;
// keeps track of where I started this current word from
int current_pos = 0;
// Conitnue till you reach \0
while(1){
if (*p == '\0') break;

You correctly note that you want to continue until reaching the null
character in the string.

However you do not have a null character in your string.
> char *p = "my name is daniel";
Yes, there is a null character terminating the above string.
>Try :
char *p = "my name is daniel\0";
That's just a waste of memory, putting in 2 nulls.

Feb 18 '07 #6

P: n/a

On Sat, 17 Feb 2007, Zack wrote:
>
However you do not have a null character in your string.
Try :
char *p = "my name is daniel\0";
If you don't know much about C yet, please try not to volunteer
"answers" to other newbies' questions. You will be wrong, and other
people in the newsgroup will have to spend extra time un-confusing
the newbie. Don't worry, there will always be other newbies --- so
you don't need to jump all over yourself to respond to each one.
You can afford to wait until you know the language better.

To the OP: Ignore Zack's post that I just quoted. Your problem
is with modifying the string literal. Put the string's characters
in an array first; then you'll be able to change their values.

-Arthur
Feb 18 '07 #7

P: n/a
Zack wrote:
DanielJohnson wrote:
>// Program to reverse each word in the string
#include<stdio.h>

int main()
{
void reverse_string(char *, int, int);
char *p = "my name is daniel";
>
You correctly note that you want to continue until reaching the null
character in the string.

However you do not have a null character in your string.
Try :
char *p = "my name is daniel\0";
This is truly horrendous advice. You completely wrong about the absence
of a null character; Daniel's string has one by definition. And that is
not the problem. He is trying to modify a string literal. This is
fully covered in the FAQ. Both you and Daniel should read it.

Daniel needs to declare p not as a pointer to a string literal but to either
a) declare p as a character array
or
b) declare p as a pointer, for which he would then allocate memory
(via malloc) and to which allocated space he would copy the string
literal (via strcpy).
Either of these strategies would give him a modifiable char array.

Feb 18 '07 #8

P: n/a
Arthur J. O'Dwyer wrote:
If you don't know much about C yet, please try not to volunteer
"answers" to other newbies' questions. You will be wrong, and other
people in the newsgroup will have to spend extra time un-confusing
the newbie. Don't worry, there will always be other newbies --- so
you don't need to jump all over yourself to respond to each one.
You can afford to wait until you know the language better.
I will keep quiet.

--
Zack
Feb 18 '07 #9

P: n/a
Zack wrote:
...snip...
I will keep quiet.
That's much better..you messed up with the earlier question as well!
Feb 18 '07 #10

P: n/a
On Feb 17, 9:38 pm, "DanielJohnson" <diffuse...@gmail.comwrote:
On Feb 18, 12:31 am, gordonb.x6...@burditt.org (Gordon Burditt) wrote:
>I wrote this small program to reverse each word in the string. For
>example: "I love You" should print as "I evoL uoY". I get Segmentation
>Fault (core dumped) error upon running the program. It compiles fine.
You stored the test string in a quoted string literal. C is permitted
to store such data in a read-only section of the program. If you
try writing on it, KABOOM!
Note also that you keep incrementing p, losing track of where the
beginning of the string is. That's not good when you try to print it.
>// Program to reverse each word in the string
>#include<stdio.h>
>int main()
>{
void reverse_string(char *, int, int);
char *p = "my name is daniel";
// keeps count of number is char in the word to reverse
int count = 0;
// keeps track of where I started this current word from
int current_pos = 0;
// Conitnue till you reach \0
while(1){
if (*p == '\0') break;
count = 0;
while(*p != ' '){
if (*p == '\0') break;
count++;
p++;
}
reverse_string(p, current_pos, count);
if (*p == ' '){
p++;
count++;
current_pos = count;
}
}
puts(p);
return 0;
>}
>void reverse_string(char* s, int start, int count){
int counter = count/2;
int i = 0;
while(i < counter){
*s = *(s-count);
s--;
i++;
}
>}
>Any suggestions......Every help is appreciated.
>Thanks

What should I do prevent KABOOM...I am newbie..give me some tips...
Read the FAQ at http://c-faq.com/

Feb 18 '07 #11

P: n/a
DanielJohnson said:

<snip>
What should I do prevent KABOOM...I am newbie..give me some tips...
Own the memory you use. There's more to it than just making the data
writeable, however. I changed your program to use writeable data, and
it still blows up. Here is a version that doesn't. Read, mark, learn,
and inwardly digest.

#include <stdio.h/* note the space between ude and <std */

/* function prototypes belong at file scope */
void reverse_substring(char *s,
char *e);

int main(void) /* proper declarator for main */
{
/* own the data */
char data[] = "my name is daniel";

/* keep two pointers - p will track the
beginning of a word, q the end */

char *p = data;
char *q = data;

/* stop when we hit the end */
while(*p != '\0')
{
/* skip past leading spaces */
while(*p == ' ')
{
++p;
}
q = p;
while(*q != '\0' && *q != ' ')
{
++q;
}
if(q p)
{
/* we've found the end of a word, so reverse it */
reverse_substring(p, q - 1);

/* point to start of next word */
p = q;
}
}

/* write the result */
puts(data);
return 0;
}

void reverse_substring(char *s,
char *e)
{
char t = 0;

while(s < e)
{
t = *s;
*s++ = *e;
*e-- = t;
}

/* ain't that a lot simpler? :-) */

return;
}

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Feb 18 '07 #12

P: n/a
"DanielJohnson" <di********@gmail.comwrites:
I wrote this small program to reverse each word in the string. For
example: "I love You" should print as "I evoL uoY". I get Segmentation
Fault (core dumped) error upon running the program. It compiles fine.
[snip]
char *p = "my name is daniel";
[snip]
reverse_string(p, current_pos, count);
The comp.lang.c FAQ is at <http://www.c-faq.com/>. You've asked
question 1.32.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Feb 18 '07 #13

P: n/a
On Feb 18, 6:47 am, Zack <goldszs...@gmail.comwrote:
Arthur J. O'Dwyer wrote:
If you don't know much about C yet, please try not to volunteer
"answers" to other newbies' questions. You will be wrong, and other
people in the newsgroup will have to spend extra time un-confusing
the newbie. Don't worry, there will always be other newbies --- so
you don't need to jump all over yourself to respond to each one.
You can afford to wait until you know the language better.

I will keep quiet.

I don't think that's a good idea. Two proven methods for
learning any subject are: 1) make mistakes, 2) teach someone
else. If you combine those two by making errors while you
try to teach someone, there is only a danger
if you have no one to correct your mistakes.
There is no shortage of such people on c.l.c. If you wait
until you have full mastery of a subject before you try
to answer someone's question, you will never answer
anyone's questions.

It is a good idea, however, to make an effort to ensure
that your replies are correct. A very good way to
gauge that you understand something is to post an explanation
here and see if it gets trounced.

--
Bill Pursell

Feb 18 '07 #14

P: n/a
On Feb 18, 3:08 am, Richard Heathfield <r...@see.sig.invalidwrote:
DanielJohnson said:

<snip>
What should I do prevent KABOOM...I am newbie..give me some tips...

Own the memory you use. There's more to it than just making the data
writeable, however. I changed your program to use writeable data, and
it still blows up. Here is a version that doesn't. Read, mark, learn,
and inwardly digest.

#include <stdio.h/* note the space between ude and <std */

/* function prototypes belong at file scope */
void reverse_substring(char *s,
char *e);

int main(void) /* proper declarator for main */
{
/* own the data */
char data[] = "my name is daniel";

/* keep two pointers - p will track the
beginning of a word, q the end */

char *p = data;
char *q = data;

/* stop when we hit the end */
while(*p != '\0')
{
/* skip past leading spaces */
while(*p == ' ')
{
++p;
}
q = p;
while(*q != '\0' && *q != ' ')
{
++q;
}
if(q p)
{
/* we've found the end of a word, so reverse it */
reverse_substring(p, q - 1);

/* point to start of next word */
p = q;
}
}

/* write the result */
puts(data);
return 0;

}

void reverse_substring(char *s,
char *e)
{
char t = 0;

while(s < e)
{
t = *s;
*s++ = *e;
*e-- = t;
}

/* ain't that a lot simpler? :-) */

return;

}

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999http://www.cpax.org.uk
email: rjh at the above domain, - www.

Thanks for such an elegant solution. I learned two things about string
literal. I apologize that I didn't look up C FAQs before.

I am using gcc compiler on Ubuntu. Is gdb the only debugger in linux.
Can you name a few which can help speed up my progress.

thanks

Feb 18 '07 #15

P: n/a
DanielJohnson said:

<snip>
I am using gcc compiler on Ubuntu. Is gdb the only debugger in linux.
No, but it's "best of breed".
Can you name a few which can help speed up my progress.
Clarity of thought is the best debugger there is. I've spent way too
much time stepping uselessly through code, one line at a time. A penny
of brainwork is worth a pound of code-stepping.

But on the rare occasions when I do use a debugger, gdb is the one I
use. On Linux, I see no more reason to use some other debugger instead
of gdb than I do to use some other C compiler instead of gcc.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Feb 18 '07 #16

P: n/a
On Feb 18, 4:25 pm, "DanielJohnson" <diffuse...@gmail.comwrote:
I am using gcc compiler on Ubuntu. Is gdb the only debugger in linux.
Can you name a few which can help speed up my progress.
An afternoon spent learning gdb will "speed up your progress" day in,
day out for the rest of your life.

--
"One of the great strengths of C from its earliest days has been its
ability to manipulate sequences of characters."
- P. J. Plauger

Feb 18 '07 #17

P: n/a
"DanielJohnson" <di********@gmail.comwrites:
[...]
I am using gcc compiler on Ubuntu. Is gdb the only debugger in linux.
Can you name a few which can help speed up my progress.
<OT>
"ddd" is a graphical frontend to gdb; it can also be used with other
debuggers.
</OT>

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Feb 18 '07 #18

P: n/a
>>>>"BP" == Bill Pursell <bi**********@gmail.comwrites:

BPIt is a good idea, however, to make an effort to ensure that
BPyour replies are correct. A very good way to gauge that you
BPunderstand something is to post an explanation here and see if
BPit gets trounced.

Posting incorrect information here is not "an effort to ensure that
your replies are correct," however. That involves going to the FAQ
and to the good C references (K&R, the Standard, and Harbison &
Steele) to ensure that you're correct *before* you post.

That said, it's been nearly 20 years since I started programming in C,
and I'm still really gratified when I post code here that nobody finds
flaw in....

Charlton

--
Charlton Wilbur
cw*****@chromatico.net
Feb 18 '07 #19

P: n/a

"Richard Heathfield" <rj*@see.sig.invalidwrote in message
DanielJohnson said:

<snip>
>I am using gcc compiler on Ubuntu. Is gdb the only debugger in linux.

No, but it's "best of breed".
>Can you name a few which can help speed up my progress.

Clarity of thought is the best debugger there is. I've spent way too
much time stepping uselessly through code, one line at a time. A penny
of brainwork is worth a pound of code-stepping.

But on the rare occasions when I do use a debugger, gdb is the one I
use. On Linux, I see no more reason to use some other debugger instead
of gdb than I do to use some other C compiler instead of gcc.
My problem is that I am always switching systems.
Once you get into a compile / debug habit, it is a real nuisance to have to
adapt to a different debugger. So generally I just don't use them.
Feb 18 '07 #20

P: n/a
"Arthur J. O'Dwyer" wrote:
>
On Sat, 17 Feb 2007, Zack wrote:

However you do not have a null character in your string.
Try :
char *p = "my name is daniel\0";

If you don't know much about C yet, please try not to volunteer
"answers" to other newbies' questions. You will be wrong, and other
people in the newsgroup will have to spend extra time un-confusing
the newbie. Don't worry, there will always be other newbies --- so
you don't need to jump all over yourself to respond to each one.
You can afford to wait until you know the language better.
[...]

On the other hand, posting "wrong" answers will be quickly corrected,
as long as they are C related. (One of the reasons that keeps getting
pointed out as to why you shouldn't give OT answers to OT questions,
without at least pointing them somewhere they can be on-topic -- the
fact that posters here can't necessarily correct "wrong" answers as
this.)

Also, it's not just newbies that post "wrong" answers. I have been
programming in C for over 20 years, and I have been corrected here
on more than one occasion, when I posted an answer based on what I
"learned" 20 years ago, and which turned out to be wrong.

Besides, now Zack's misconception won't get in the way in the future.

However, I do agree that newbies should take their time before
making such bold answers. (Though it is a bit of a Catch-22, since
no one would have corrected Zack's misconception had he not posted.)

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h|
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:Th*************@gmail.com>

Feb 19 '07 #21

P: n/a
Kenneth Brody wrote:
"Arthur J. O'Dwyer" wrote:
If you don't know much about C yet, please try not to volunteer
"answers" to other newbies' questions.
On the other hand, posting "wrong" answers will be quickly corrected,
as long as they are C related.

My recommendation is for the less experienced participants to answer
the question in their heads, then compare with the posted answers. If
there's a major difference, and it's not clear why, then ask about it.


Brian
Feb 19 '07 #22

P: n/a
Richard Heathfield wrote:
DanielJohnson said:

<snip>
>I am using gcc compiler on Ubuntu. Is gdb the only debugger in linux.

No, but it's "best of breed".
>Can you name a few which can help speed up my progress.

Clarity of thought is the best debugger there is. I've spent way too
much time stepping uselessly through code, one line at a time. A penny
of brainwork is worth a pound of code-stepping.
And depending on when you started, this could be 240 to 1. :-)

On my first trip to England, about 40 years ago now, a pint of bitter
cost one and six. A tot of gin with tonic was two shillings. Those were
the days.

Twelve pence to the shilling, twenty shillings to the Pound. As I recall
a Pound cost about five Dollars US. Those were the days.

I haven't been back to the UK for thirty years now. What does a pint of
bitter cost today?

Here in Washington, DC a drink (even beer) will average five to six
dollars today in nicer places. Two dollars is about as low as you can go.

Do y'all still drive on the 'wrong' side of the road? Why is that?

--
Joe Wright
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Feb 19 '07 #23

P: n/a
Joe Wright said:

<snip>
I haven't been back to the UK for thirty years now. What does a pint
of bitter cost today?
A couple of quid (about four bucks, I think).
Here in Washington, DC a drink (even beer) will average five to six
dollars today in nicer places. Two dollars is about as low as you can
go.

Do y'all still drive on the 'wrong' side of the road?
Nobody here drives on the wrong side of the road, except when overtaking
or when risking the wrath of the law (and society at large) by driving
home from spending a tenner in the pub...
Why is that?
Well, if you're asking why we drive on the proper - i.e. the left - side
of the road, the answer is simple: if the driver of the oncoming
vehicle attacks you, you want him on your right, because that's the
side on which your sword will be most effective (if, like most people,
you're right-handed). You can use the other hand to control the horses.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Feb 19 '07 #24

P: n/a
In article <DN******************************@bt.com>,
Richard Heathfield <rj*@see.sig.invalidwrote:
>Well, if you're asking why we drive on the proper - i.e. the left - side
of the road, the answer is simple: if the driver of the oncoming
vehicle attacks you, you want him on your right, because that's the
side on which your sword will be most effective (if, like most people,
you're right-handed).
I knew there was a reason I never learnt to drive.

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Feb 19 '07 #25

P: n/a
On Feb 19, 6:18 pm, Richard Heathfield <r...@see.sig.invalidwrote:
Joe Wright said:

<snip>
I haven't been back to the UK for thirty years now. What does a pint
of bitter cost today?

A couple of quid (about four bucks, I think).
Here in Washington, DC a drink (even beer) will average five to six
dollars today in nicer places. Two dollars is about as low as you can
go.
Do y'all still drive on the 'wrong' side of the road?

Nobody here drives on the wrong side of the road, except when overtaking
or when risking the wrath of the law (and society at large) by driving
home from spending a tenner in the pub...
Why is that?

Well, if you're asking why we drive on the proper - i.e. the left - side
of the road, the answer is simple: if the driver of the oncoming
vehicle attacks you, you want him on your right, because that's the
side on which your sword will be most effective (if, like most people,
you're right-handed). You can use the other hand to control the horses.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999http://www.cpax.org.uk
email: rjh at the above domain, - www.
I came across this link on wikipedia about left and right hand
driving. I visited UK this December and was pleasantly surprised to ee
the traffic the other way but in couple of days I think I could
adjust.

http://en.wikipedia.org/wiki/Driving..._left_or_right

Daniel

http://en.wikipedia.org/wiki/Driving..._left_or_right

Feb 20 '07 #26

P: n/a
Richard Heathfield wrote:
Joe Wright said:
.... snip ...
>>
Do y'all still drive on the 'wrong' side of the road?

Nobody here drives on the wrong side of the road, except when
overtaking or when risking the wrath of the law (and society at
large) by driving home from spending a tenner in the pub...
>Why is that?

Well, if you're asking why we drive on the proper - i.e. the
left - side of the road, the answer is simple: if the driver of
the oncoming vehicle attacks you, you want him on your right,
because that's the side on which your sword will be most
effective (if, like most people, you're right-handed). You can
use the other hand to control the horses.
I think that story is flawed. In the envisioned scenario, you
could get better sword action by keeping right. However, for
couched lances, keeping left makes more sense. Check it out with
Galahad, Lancelot, Bedevere, etc.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>

"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
Feb 20 '07 #27

P: n/a
CBFalconer said:
Richard Heathfield wrote:
>>
Well, if you're asking why we drive on the proper - i.e. the
left - side of the road, the answer is simple: if the driver of
the oncoming vehicle attacks you, you want him on your right,
because that's the side on which your sword will be most
effective (if, like most people, you're right-handed). You can
use the other hand to control the horses.

I think that story is flawed. In the envisioned scenario, you
could get better sword action by keeping right.
I disagree, and suggest that we test the matter by pitting the two
techniques against each other. We'll start our stagecoaches at opposite
ends of the lane, draw swords, and - on the word of command - set off
towards each other, with my vehicle firmly on the left side of the road
and yours firmly on the right. Last one standing buys the drinks.
However, for
couched lances, keeping left makes more sense. Check it out with
Galahad, Lancelot, Bedevere, etc.
I don't think they ever drove vehicles for a living.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Feb 20 '07 #28

P: n/a
Joe Wright <jo********@comcast.netwrote:
Richard Heathfield wrote:
Clarity of thought is the best debugger there is. I've spent way too
much time stepping uselessly through code, one line at a time. A penny
of brainwork is worth a pound of code-stepping.
And depending on when you started, this could be 240 to 1. :-)

On my first trip to England, about 40 years ago now, a pint of bitter
cost one and six. A tot of gin with tonic was two shillings. Those were
the days.

Twelve pence to the shilling, twenty shillings to the Pound. As I recall
a Pound cost about five Dollars US. Those were the days.

I haven't been back to the UK for thirty years now. What does a pint of
bitter cost today?
Depends. Do you want to pay Cock's Egg Tax or not?
Here in Washington, DC a drink (even beer) will average five to six
dollars today in nicer places. Two dollars is about as low as you can go.
I don't think you could easily get a pint under two pounds in the Great
Wen. You certainly can easily get one more expensive than that. They're
cheaper Oop North.
Do y'all still drive on the 'wrong' side of the road? Why is that?
Yes, because they're still all brigands.

Richard
Feb 20 '07 #29

P: n/a
On Mon, 19 Feb 2007 23:18:37 +0000, in comp.lang.c , Richard
Heathfield <rj*@see.sig.invalidwrote:
>Joe Wright said:

<snip>
>I haven't been back to the UK for thirty years now. What does a pint
of bitter cost today?

A couple of quid (about four bucks, I think).
Crikey. You clearly don't live in London... :-(
>Do y'all still drive on the 'wrong' side of the road?
Only after drinking lots of bitter...

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Feb 22 '07 #30

This discussion thread is closed

Replies have been disabled for this discussion.