Im using it in a class of mine...and I have crashed it 4 times in the past 3 hours....in programs that go to the extent of this
(In this programs case it crashed while building because I forgot a }....so sad...)
#include<iostream.h>
class Item
{
int number;
float cost;
public:
void getData(int a, float b);
void putData(void);
nah...with visual C++ everythings fucked up...it looks like it should work...I learned on that too, shit sucks.
Name:
Anonymous2005-07-26 6:01
I learned on Borland, it was pretty OK.
g++ ftw though.
Name:
Anonymous2005-07-26 9:41
There's always Dev-C++.
Name:
Anonymous2005-07-26 14:00
use g++ problem solved
Name:
Anonymous2005-07-26 18:09
>>1
please replace getData by setData at once, you're not getting anything here, you're setting those values. And create two != methods: setNumber(int) and setCost(float).
The putData method is awful two: an object shouldn't be aware of its environment and print anything on the screen (or call it toString or debugPrint...). Use:
cout << object.data () << endl; instead.
Name:
Anonymous2005-08-07 14:20
It actually helps if you DO program the operator "="
Name:
Anonymous2005-08-07 16:56
Unless of course you /like/ Java's foo.equals(bar) bullshit.
Name:
Anonymous2005-08-10 7:12
>>7 is right on. Your get/put semantics are reversed. And while you're at it, C++ uses <iostream> with the iostream entities in the std namespace, not <iostream.h>. What version of MSVC++ are you using? 5 or 6?
Name:
Anonymous2005-08-10 10:14 (sage)
>>9
Disregard that, I don't know the difference between = and ==.
Name:
Anonymous2006-04-03 14:43 (sage)
LOL
<code>
lol internet
</code>
Name:
Anonymous2006-04-03 14:43 (sage)
LOL lol internet
Name:
Anonymous2006-04-09 15:17 (sage)
>>11
Also note that you can create an array this way too: Box boxen[] = {new Box(br.readLine(), new Box(br.readLine(),...new Box(br.readLine()};
Name:
testing2006-04-09 16:18 (sage)
blah, blah, blah STUFF GOES HERE
Name:
Anonymous2006-04-12 6:39
code?
Name:
Anonymous2006-04-12 11:24 (sage)
Try this instead: class Item
attr_accessor :number, :cost
def to_s
"Item: number = #@number, cost = #@cost"
end
end