@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12



Comments:

<0> I recommend the books here: http://rudbek.com/books.html
<1> yes, you told me
<2> well.. i just started learnig c++ i didnt have any time to bya a book
<1> he was talking to me...
<3> applies to everyone, heh
<1> how comforting :)
<3> niGhTm4r3|bu you should start learning c++ BY buying a book
<2> where can i find a good doc? or a online book?
<0> there aren't really any
<1> vawjr, can you do this:
<1> g++ -I. -O2 -c main.cpp MyVector.cpp
<1> g++ -o MyVector_prog main.o MyVector.o -lm
<0> corstan I don't use g++ that often without make
<1> anyone looked at this: http://www.noidea128.org/sourcefiles/15817~ ?
<1> I can compile with: g++ -I. -O2 -c main.cpp MyVector.cpp
<1> but when linking I get that



<4> Get what?
<1> the URL
<0> what do you expect this line to do: tmp(i) = a(i) + b(i);
<4> Did you define that operator?
<4> (well, those, not that
<4> )
<0> a(i) is one of those missing ones
<1> vawjr, no that extraction addition no
<0> I just copied the line from the loop in your operator +()
<0> so what do YOU expect it to do?
<0> since that's causing the 1st error
<1> you mean this prototype: MyVector operator+ (const MyVector& a, const MyVector& b); ?
<4> Yeah, but the definition
<0> line 117 of your posted source
<3> did we see this MyVector.h yet?
<1> hm, I don't have any operator definitions for v(i) = a, or a = v(i)
<3> and see that the operators are declared members in the header, but not defined?
<1> rdragon, didn't you see MyVector.h ?
<0> corstan what do you WANT it to do?
<3> corstan - no
<1> http://www.noidea128.org/sourcefiles/15813.html
<0> corstan why do you want to use () for subscripting when C++ already uses [] for subscripting?
<3> why aren't you just using std::vector ?
<1> rdragon, I told you
<1> vawjr, it follows from the exercise
<3> I don't remember asking
<1> but I told you anyways :)
<0> what exercise?
<1> rdragon,
<1> vawjr given that std::vector exists
<1> corstan educational, not very effective I know
<1> corstan I'll ignore that std::vector exists
<1> corstan until now
<1> vawjr,
<1> corstan it's an exercise in learning cl***es and OOP in C++
<0> corstan says who?
<0> did you make it up yourself?
<1> the task specification gives some hints, my I have to implement the header file, function bodies, and test it using main.cpp
<0> "task specification" .... this is homework?
<0> take home test??
<1> home test?
<1> home work being I do this at home :)
<1> not getting any credits for this, just learning C++
<1> got any problem with that?
<1> : undefined reference to `MyVector::operator()(int) const'
<1> and
<1> : undefined reference to `MyVector::operator()(int)'
<1> ok, got to make function bodies for these then in MyVector.cpp
<0> corstan well, you're NOT learning very well.... what are you using for references as you try to learn?
<1> tutorials, wikipedia, AND "C++ pocket reference" by O'Reilly
<1> yeah, I have seen your list
<0> now, if you're only ever going to write code for you to use.... have fun, but if you expect to interface w/ others you should at least try to stay w/ the conventions already established
<1> did I break any conventions?
<0> if I were you, I'd throw all of those away, ... well except maybe the pocket reference, I haven't seen it
<1> only you protested
<0> yes, you're using () for subscripting
<0> and I commented on it
<1> I can't throw away wikipedia
<0> quit using it, it's NOT helping
<4> wikipedia to learn a language?



<0> and your running your indexes from 1 to size
<1> yes
<1> that is more natural
<0> corstan not to ANYONE else using C++
<1> no, but this is a cl*** trying to imitate a mathematical vector
<1> try Matlab
<0> I have matlab
<1> ok
<0> I don't give a **** about Matlab... C++ is a DIFFERENT language
<1> I didn't say it was/wasn't
<1> ok, I'll stop
<0> then why are you trying to use Matlab conventions in a C++ program?
<0> and expect us to help you find problems
<1> ?
<0> () and arrays starting at 1
<1> all I wanted is to ask why got those errors in the linking process as given in: http://www.noidea128.org/sourcefiles/15817~
<1> but never mind
<5> One of the hardest things to learn, I found, was yielding to the conventions oof the language I was using
<5> But it's worth it
<0> I think I already gave you that answer
<0> but you're making it very difficult for us to help because you think you know better how to write things
<0> WE are all used to [] and arrays starting at 0
<0> so when you decide to do different, we have a great deal of difficulty reading what you wrote
<1> sure, I know, and so am I
<6> Monday Night
<6> Mostly cloudy. A 30 percent chance of showers in the evening. Windy...colder. Lows in the lower 40s. North winds 10 to 20 mph increasing to 20 to 25 mph after midnight
<1> if I knew any better I would just said to person asking why:
<1> MyVector.o(.text+0x268): In function `operator+(MyVector const&, MyVector const&)':
<1> : undefined reference to `MyVector::operator()(int)'
<1> occured
<1> .... that
<1> he didn't have any operator() definition in his/her code
<1> but whatever
<0> I think that's what I said
<0> although I first asked what you thought operator ()(int) would do?
<0> because that line 117 will confuse the **** out of anyone familiar w/ C++ who reads it
<7> do u ever sleep?
<7> ;>
<0> no
<1> ok, but you also said that it couldn't find the header file
<0> but I gotta make another p*** up/down the "driveway"
<1> brb
<0> the FIRST set of errors that I saw (posted by rdragon ) showed a missing .h file
<0> ...driveway with the snow blower...back in a while
<0> the driveway is about 300 meters long
<8> guys I think you should add "Don't read any Herbet Schild Book" at that page: http://rudbek.com/books.html ;)
<1> can I write an overloaded operator body like this:
<1> double MyVector::&operator() (int i) { something }
<1> ?
<1> with that &operator()
<1> and what it actually mean to be: &operator() ?
<1> reference to the functor?
<9> Kia Ora
<1> I have this in MyVector.cpp:
<1> double MyVector::&operator() (int i) {
<1> // something here
<1> return 2.3;
<1> }
<1> and I have this in MyVector.h:
<1> double &operator() (int i);
<1> in the cl*** MyVector
<1> why do I get this:
<1> MyVector.cpp:60: error: expected unqualified-id before '&' token
<1> MyVector.cpp:60: error: expected init-declarator before '&' token
<1> MyVector.cpp:60: error: expected `,' or `;' before '&' token
<1> this substr. prolly messes things up: MyVector::&operator
<1> anyone?
<10> remove the &
<1> but I need that since it's in the h-file
<1> double &operator() (int i); // v(i) = a;
<1> how do you make a body for that?
<10> it would be double &Object::operator()
<10> but, that makes no sense
<10> cause your returning a value


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #c++
or
Go to some related logs:

#linuxhelp
#AllNiteCafe
skype perl
SIKIYOM
#MissKitten
#linux
#teens
#skype
maple story in directdraw
#linux



Home  |  disclaimer  |  contact  |  submit quotes