|
Yes, I'm definitely interested in seeing how you did it. I still don't completely know how I want to go about doing this, so it would be nice to have something to look at.
Thanks so much.
|
|
|
|
|
Want me to send this to you via email?
"It is better to remain silent and be thought a fool than to open one's mouth and remove all doubt." - Abraham Lincoln
|
|
|
|
|
Yeah, can you send it through this, or do i have to give you my email address? (I don't mind if i have to, it's not that big of a deal really)
|
|
|
|
|
|
Ok, i saw the ? thing used in some code, and i dont know what it does. I tried googling, but, um, i dont know what its called, and you cant google for "c++ ?" very easily.
So, what is it called so i can google for it lol.
*.*
cin >> knowledge;
|
|
|
|
|
You mean like: int foo = (blah == 2) ? 1 : 0; or something like that? If so, that's a conditional expression, referred to variously as "immediate if", the "ternary operator", the "conditional operator", or simply the "?:" operator. It's basically an "if..then..else" type of expression that returns a value. Users of functional languages are very familiar with doing conditionals like this.
- Mike
|
|
|
|
|
|
ok, so in the example above, it basically means
<br />
(if blah == 2)<br />
{<br />
foo = 1;<br />
}<br />
else<br />
{<br />
foo = 0;<br />
}<br />
<br />
pretty neat...thanks-o.
*.*
cin >> knowledge;
|
|
|
|
|
|
Hi,
do you mean the ? : operator????
This is just an abbreviation for an if else statement used in C++. Consider the following for example:
return x = a ? b< c : d > a;
In this case x is either (b<c) or="" (d="">a) depending on the programming return value.
Hope it helps.
Regards.
Alex
|
|
|
|
|
I was able to redistribute MSXML4 using a msi package. everything worked ok till i was working as administrator on a Windows 2000 box , when I logged on as a user I got an error in the XML part of the code saying that the object couldnt be created ! What do i need to do ?
|
|
|
|
|
Might be a permissions issue. Do you have the error code?
|
|
|
|
|
I am pretty confidant its bcos of permissions or things not getting setup globally ( like for all users , admins etc ) .
hr=m_plDomDocument.CreateInstance("Msxml2.DOMDocument.4.0");
if(FAILED(hr)){
::MessageBox(0,"Failed Dom Document CreateInstance",0,0);
I get the messageBox indicating an error while running as an User .
As an user I cannot even get access permissions to install the MSXML cab redistribution file to write certain registry keys !
|
|
|
|
|
You might want to check with the XML/XSL forum on this website.
|
|
|
|
|
I don't know much about thread programming, but I have a general question. Are threads more of an operating system function. For example there isn't any thread functions in the STL are there? Wouldn't threads be dealt with differently on Linux and Windows?
Thanks.
|
|
|
|
|
Anonymous wrote:
For example there isn't any thread functions in the STL are there?
Correct.
Anonymous wrote:
Wouldn't threads be dealt with differently on Linux and Windows?
While the implementation between the two OSs would no doubt be different, I suspect the net result of each would be somewhat similar.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi,
yes threads are part of the Operating system. Windows for example handles threads in a different manner than Unix or Linux does. Windows assigns to each thread a certain amount of time during which this thread can perform its task. If there are multiple threads at one time Windows determines which thread has priority of the others and executes this thread. Linux and Unix handle threads differently. The stl can also handle threads yet it does not have a special class or library that deals with threads. You have to write your own thread managing class or library.
|
|
|
|
|
Thanks for the information.
|
|
|
|
|
Hi all,
I was wondering if there was a way to parse a binary number that I receive over a TCP port, into either 4 bit chunks or into hex.
Thank you.
Jimmy
Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
|
|
|
|
|
DWORD dwSome32BitNumber;
WORD wFirstChunk = dwSome32BitNumber & 0x0000000f;
WORD wSecondChunk = (dwSome32BitNumber >> 8) & 0x0000000f;
WORD wThirdChunk = (dwSome32BitNumber >> 16) & 0x0000000f;
WORD wFourthChunk = (dwSome32BitNumber >> 32) & 0x0000000f;
... Does that make sense? Or you could dress it up a bit with:
WORD wChunks[8];
for (int nIndex = 0; nIndex< 8; nIndex++)
{
wChunks[nIndex] = dwSome32BitNumber & 0x0000000f;
dwSome32BitNumber >>= 8;
}
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi David,
Can you explain this to me a little more.
I think I understand , but I am not exactly sure what the dwSome32BitNumber >> 8 (16,32) or dwSome32BitNumber >>= 8 does exactly with respect to the &0x00000000f.
thanks again for your help
Jimmy
Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
|
|
|
|
|
>> and << are right and left bit-shift operators, respectively. Read about them here:
http://tinyurl.com/o94p
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I'm sorry, I posted my message incomplete.
I updated the previous post. My question basically is if you are you the bitwise & operator with the first 8bits of the number, won't it end up being 0?
So i guess my real question is what does the & 0x00000000f do after the number has been shifted 8 (16, 32)?
thank you
Jimmy
Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
|
|
|
|
|
NewHSKid wrote:
...what does the & 0x00000000f do...
Read about the bitwise-AND operator here:
http://tinyurl.com/o96t
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi David,
I know what the bitwise AND does, thats why i don't understand what you are saying. If I AND all 4 of the word chunks with 0x00000000f, then won't they all just evaluate to 0x00000000f because there is no 1's to match up to?
Please correct me, I have a feeling I am not thinking about this correctly.
Lets say I get the number as 0xA012B435. Using the bitwise AND will just make it 0. No?
Thanks for your help.
Jimmy
Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
|
|
|
|