C++ newbie needs help with linked lists



 DEVELOP > c-Plus-Plus > C++ newbie needs help with linked lists

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: "Sonoman"
Date: 08 Nov 2003 12:22:11 PM
Object: C++ newbie needs help with linked lists
Hi all:
I am trying to create an address book for a school project. So far I have a
good part of it done but I am stuck. I am getting some error that I would
not even know how to begin to explain. I have never seen these errors
before. They are illegal use of strings and missing parenthesis that I know
they are well placed. Would anyone care to look at my code to see if I can
get help to resolve these errors? I would like to be able to move on.
My source code can be found here:
http://www.cse.fau.edu/~fcarpio/
Thank you in advance.
.

User: "Sonoman"

Title: Any ideas on how to solve my original problem? 08 Nov 2003 07:40:56 PM
I did fix the ugly long lines and it worked just fine. Please help with the
original error.
"Sonoman" <fcarpio@cse.fau.edu> wrote in message
news:ruarb.63875$un.5526@bignews6.bellsouth.net...

Hi all:
I am trying to create an address book for a school project. So far I have

a

good part of it done but I am stuck. I am getting some error that I would
not even know how to begin to explain. I have never seen these errors
before. They are illegal use of strings and missing parenthesis that I

know

they are well placed. Would anyone care to look at my code to see if I can
get help to resolve these errors? I would like to be able to move on.

My source code can be found here:
http://www.cse.fau.edu/~fcarpio/

Thank you in advance.


.
User: "lilburne"

Title: Re: Any ideas on how to solve my original problem? 08 Nov 2003 07:59:19 PM
Sonoman wrote:


they are well placed. Would anyone care to look at my code to see if I can
get help to resolve these errors? I would like to be able to move on.

I'd say that the line in main():
l.save_record(string FN,...);
looks rather suspicious and likely to generate illegal use
of string and missing parentheses errors.
.


User: "Sonoman"

Title: Re: C++ newbie needs help with linked lists 08 Nov 2003 12:30:15 PM
One more question, what is the syntax to break up those very long lines that
I have?
Thanks in advance.
"Sonoman" <fcarpio@cse.fau.edu> wrote in message
news:ruarb.63875$un.5526@bignews6.bellsouth.net...

Hi all:
I am trying to create an address book for a school project. So far I have

a

good part of it done but I am stuck. I am getting some error that I would
not even know how to begin to explain. I have never seen these errors
before. They are illegal use of strings and missing parenthesis that I

know

they are well placed. Would anyone care to look at my code to see if I can
get help to resolve these errors? I would like to be able to move on.

My source code can be found here:
http://www.cse.fau.edu/~fcarpio/

Thank you in advance.


.

User: "osmium"

Title: Re: C++ newbie needs help with linked lists 08 Nov 2003 02:49:23 PM
Sonoman writes:

I am trying to create an address book for a school project. So far I have

a

good part of it done but I am stuck. I am getting some error that I would
not even know how to begin to explain. I have never seen these errors
before. They are illegal use of strings and missing parenthesis that I

know

they are well placed. Would anyone care to look at my code to see if I can
get help to resolve these errors? I would like to be able to move on.

My source code can be found here:
http://www.cse.fau.edu/~fcarpio/

Give the name of the troublesome file, the first error message(roughly) and
the approximate line number.
.
User: "Sonoman"

Title: Here is the error info 08 Nov 2003 01:55:25 PM
list.cpp
C:\Documents\ver8\list.cpp(24) : error C2447: missing function header
(old-style formal list?)
main.cpp
C:\Documents\ver8\main.cpp(23) : error C2275: 'string' : illegal use of this
type as an expression
c:\program files\microsoft visual studio\vc98\include\xstring(612) :
see declaration of 'string'
C:\Documents\ver8\main.cpp(23) : error C2146: syntax error : missing ')'
before identifier 'FN'
C:\Documents\ver8\main.cpp(23) : error C2059: syntax error : ')'
Error executing cl.exe.
"osmium" <r124c4u102@comcast.net> wrote in message
news:bojdrq$1dpsr4$1@ID-179017.news.uni-berlin.de...

Sonoman writes:

I am trying to create an address book for a school project. So far I

have

a

good part of it done but I am stuck. I am getting some error that I

would

not even know how to begin to explain. I have never seen these errors
before. They are illegal use of strings and missing parenthesis that I

know

they are well placed. Would anyone care to look at my code to see if I

can

get help to resolve these errors? I would like to be able to move on.

My source code can be found here:
http://www.cse.fau.edu/~fcarpio/


Give the name of the troublesome file, the first error message(roughly)

and

the approximate line number.


.
User: "osmium"

Title: Re: Here is the error info 08 Nov 2003 04:31:26 PM
Sonoman writes:

list.cpp
C:\Documents\ver8\list.cpp(24) : error C2447: missing function header
(old-style formal list?)
main.cpp
C:\Documents\ver8\main.cpp(23) : error C2275: 'string' : illegal use of

this

type as an expression
c:\program files\microsoft visual studio\vc98\include\xstring(612)

:

see declaration of 'string'
C:\Documents\ver8\main.cpp(23) : error C2146: syntax error : missing ')'
before identifier 'FN'
C:\Documents\ver8\main.cpp(23) : error C2059: syntax error : ')'
Error executing cl.exe.

I would use
#if 0
// suspect lines
#endif
to isolate suspect areas. When you think you have it fixed change the 0 to
a 1. If it is indeed fixed, take out the pre-processor code. I couldn't
get enough error location from what you provided to spot anything by
eyeball.
I really dislike your humungous parameter lists. A lot!
.
User: "Sonoman"

Title: Re: Here is the error info 08 Nov 2003 02:43:12 PM


I really dislike your humungous parameter lists. A lot!

Me too! How do I break the line into two or even three lines?
.
User: "Jon Bell"

Title: Re: Here is the error info 08 Nov 2003 03:22:14 PM
In article <Eycrb.65067$un.12708@bignews6.bellsouth.net>,
Sonoman <fcarpio@cse.fau.edu> wrote:


How do I break the line into two or even three lines?

Just do it. :-) Newlines and blank spaces are equivalent everywhere in
C++ code, except inside a literal (quoted) string. So everywhere you have
(or could have had) a blank space, you can put a newline instead.
If you do have to deal with a long literal string, you can break it up
into two "adjacent" literal strings. For example, you can replace
"One two three four"
with
"One two "
"three four"
--
Jon Bell <jtbellap8@presby.edu> Presbyterian College
Dept. of Physics and Computer Science Clinton, South Carolina USA
.

User: "osmium"

Title: Re: Here is the error info 08 Nov 2003 07:16:58 PM
Sonoman writes:

I really dislike your humungous parameter lists. A lot!

Me too! How do I break the line into two or even three lines?

I think you are thinking in physical terms and I am thinking in, sort of,
logical terms. I would create a new structure which had the 12 or so data
fields you have now. Then a function would receive one of these records as
a parameter. There might be a very slight speed penalty, but I think the
added clarity is worth it. IMO a list of parameters this long is kind of
mind numbing.
.






  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER