123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|740|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> C/C++/C#/Other -> Just started c++

Sun, 22 Oct 2006, 05:16
JL235
I just started learning and messing around with C++, mainly cos a free copy of Virtual Studio 2005 pro has been sitting on my desktop for a while (it is a legit copy, Microsoft are giving free software to university computer students). But anyway I'm trying to make some .dlls of previous code I used in other projects to see it I could get them to work faster, which is all going fine except I'm stuck on one bit of code.

What is the equivalent of '$ff3333 Or $ff' in c++? in Blitz it returns 16724991 (and what is it doing too) but in c++ it returns 1, pressumably doing a boolean expression.
Sun, 22 Oct 2006, 07:15
Jayenkai
Hex numbers are anything with 0x in front. eg, 0xFF3333
Oct numbers seem to be any number with a 0 at the start. Or at least that's what I found when lining up my code neatly, and then having C++ whinge at me, that 09 wasn't a number!

-=-=-
''Load, Next List!''
Sun, 22 Oct 2006, 07:36
JL235
I meant of the 'or' bit, cos it isn't being used as a logic opperator in that example.

I did work it out though thanks to wikipedia. There is a whole page for the opperators in c and c++.

I managed to get my .dll that works out an alpha formula working though, although it works slower then if I just did it in Blitz which is dissapointing, but maybe not suprising. But I did find it alot easier to work out and get to grips with the I thought I would. I've never made anything in c or c++ before, and never a .dll either. It'll be cos it's so similar to Java though.
Tue, 24 Oct 2006, 16:03
Yayyak
'I' is bitwise or, operating on the individual bits.
'II' is a logical or, evaluating both expressions and if one is true, then it returns true.

If that doesn't work, try them round the other way.
Tue, 24 Oct 2006, 16:10
Jayenkai
It's not I, it's |... The bar thing, next to Z (or at least on my keyboard!)

It used to do "|Tape", "|Disk (or was it disc)", "|CPM" and other stuff, on the CPC.


|User 12
Run "diary
Shhh

-=-=-
''Load, Next List!''
Tue, 24 Oct 2006, 16:23
Yayyak
Oops. I can type, honest. I looks so close to |, in the reply box. But yes. Do what Jay says, and you won't go wrong!

Edit: My | key is above the return key. How odd.
Tue, 24 Oct 2006, 16:27
Jayenkai
The CPC's | is next to the P.
Tue, 24 Oct 2006, 17:54
Scherererer
my pipe (| is called the pipe) is above the enter key, as it should be!

-=-=-
YouTube Twitter
Computer Science Series: Logic (pt1) (part 2) (part 3) 2's Complement Mathematics: Basic Differential Calculus
Tue, 24 Oct 2006, 18:03
Yayyak
IIRC, it was originally called the vertical bar, and this is it's proper name. The UNIX dudes (Bourne & Thompson specifically) took this bar and used it for the syntax for the UNIX 'pipe', hence the name.