|
Why can't you just try it?
I've used >> only in C# before, but assuming they do the same in C anc C#, this should be the answer:
11001001 >> 1 = 01100100
11001001 >> 2 = 00110010
11001001 >> 3 = 00011001
11001001 << 1 = 10010010
11001001 << 2 = 00100100
11001001 << 3 = 01001000
It is a shift operator, not a rotation operator.
_________________________________
Please inform me about my English mistakes, as I'm still trying to learn your language!
|
|
|
|
|
I would have tried but I do not have any C/C# or any other interpreter here on my machine I could try it with. But a friend of mine asked me. That's why I decided to put it here! Because the MSDN is quit loosy concerning the operators.
but thanks for the examples.
Stephan.
|
|
|
|
|
Corinna John wrote:
but assuming they do the same in C anc C#
only if not overloaded
David
|
|
|
|
|
It's a standard shift. There is no circular shifting.
Keep in mind, though, that right-shifting is performed *with sign extensions*! That is, there are three cases:
1) The number to be shifted is unsigned (i.e. byte, ushort, uint, ulong). In this case, the bit shifted in from the left is '0'. For example, (byte) 10010010 >> 2 = 00100100.
2) The number to be shifted is signed (i.e. sbyte, short, int, long) and the MSB is 0. Then the bit shifted in from the left is '0'. For example, (sbyte) 01001000 >> 2 = 00010010.
3) The number to be shifted is signed and the MSB is 1. Then the bit shifted in from the left is '1'. For example, (sbyte) 10010010 >> 2 = 11100100.
Hope this helps!
|
|
|
|
|
Hi
I have a question about "Windows Services":
What is the Windows Service?
I need a complete explanation about it.
Please introduce me some papers or sites or good books ,if enyone knows.
Thanks,Mojtaba
|
|
|
|
|
Tanhatarin wrote:
Please introduce me some papers or sites or good books ,if enyone knows.
Google is a good place to start. Also go to your control panel/Administrative Tools/Services. Those are services. They are programs that run all the time and provide 'services' to other programs running on your PC.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks for your help,Christian Graus
But I know these.
I need some information about "Windows Service" and it's capability to intract with system.
Please help me immediately!
Thanks,Mojtaba
|
|
|
|
|
Tanhatarin wrote:
Please help me immediately!
Of course, after all, I'm being paid for this, right ?
Tanhatarin wrote:
I need some information about "Windows Service" and it's capability to intract with system.
www.google.com is still a great place to start. I'd answer if you had a specific question, but it seems to me that you've done nothing to try and get an answer yourself, and the question is so broad, I could spend a day answering it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
That's right
One of my specific question is that :
I have some different programs( applications ) that all of them use the same "Search" system.
I have presented these programs to the customers.
I want to delete the "Search" system from them and write a windows service for this "Search" system.
Is it possible that all of the users( customers ) use this service instead of useing the "Search" system in each programs.
if your answer is "Yes" :
Shuld I present this service with programs or not.
Please guid me!
|
|
|
|
|
Do they all search the same data ?
A service is a good way to get multiple programs to call the same exe. I've used them to share session state between asp and asp.net, for example.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks a lot
can you introduce me some good books about "Windows Services" ?
|
|
|
|
|
Does anybody have any experience forcing a form to only be able to resize diagonally?
There's no magic property out there that'll do it, and I'm getting a little frustrated trying to play with logic inside the "layout" events of the form and/or the graph control (an extended panel).
I'm writing a graphing application, and my main window is split into two panes: Options/settings pane docked on the left, and the actual graph docked on the right. I want things setup so that no matter how the user resizes the form, the following things are true:
1) The two panes don't overlap, ever.
2) The graph control is always square
3) The graph control boundaries don't go past the right edge of the form.
4) !(extra horizontal space && extra vertical space between graph and edges of form)
It seems like my best bet is to figure out how to only allow diagonal (and therefor, matching vertical & horizontal) resizes, and just make sure the graph is square when the program starts up.
Sorry to write #4 in code, but I couldn't figure out an unambiguous way of phrasing it in english:P
-Alex
|
|
|
|
|
a bit cludgy, but works:
<br />
private void Form1_Resize(object sender, System.EventArgs e)<br />
{<br />
this.Width = this.Height;<br />
}<br />
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|
|
I created a window service.
The service can't be stopped when there is a bug in the service (eg: miss out the "<" in the config file). The window service status is STOPPING. In this case, i have to restart the PC in order to stop this window service.
Is there any other ways to stop the service without restart the PC? Pls help! Thanks in advance!
|
|
|
|
|
|
Thanks! So there will be 2 threads, first thread is for the whole process, second thread is for the main function of the service, is it? if any error in thread 2, we should call the onStop method?
I'm sorry that i'm not clear about implement the onstop override. can i have any simple example?
|
|
|
|
|
Hi Everybody
I have some questions about windows Services
1)I want to have an introduction to Windows Services
1)What is the Windows Service?
2)What dose it do?
3)How dose it interact with system ?
Please answer me these questions immmediately!
Thanks!
|
|
|
|
|
MojFar wrote:
Please answer me these questions immmediately!
Please use the search form on top of the page immediately!
_________________________________
Please inform me about my English mistakes, as I'm still trying to learn your language!
|
|
|
|
|
Hi, I currently faced a problem on inserting decimal value from vb .net into SQLCE which declared as money data type. ANyone know how to solve this??
Thanks in advance!
|
|
|
|
|
Hi,
I want to send SNMP Trap messages from my .NET program. I have read about WMI being able to connect to SNMP servers but dont know if Traps can be sent.
Thanks.
|
|
|
|
|
Hi everybody
I want to create a windows service in "Visual C++.Net"
How shudle I do this ?
Please help me such as a wizard for this creatrion!
I want to use the "MFC" for this. Is it possible or not ?
Please help me immediately
|
|
|
|
|
MFC is primarily for writing Windows apps. Why would you want to use it for a web service ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi Christian Graus
How can you help me to create a windows service in another way ?
|
|
|
|
|
If you go into the new project wizard for C++, there is a template for ASP.NET web service. It uses managed c++, meaning your code will require the .NET framework to be installed on the target machine.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
what is your idia about deference between "Web Service" and "Windows Services"?
Is there any deference between them ?
|
|
|
|