|
though richard solutions is best.. i am suggesting simpler approach for this in my college days
int result = i*100 + j *10 + k;
Jokes apart! are you looking for it's integer equivalent. i.e. say you have bits like this i=1,j=0,k=0 for which decimal equivalent is 4 ( binary of 100 = 4 i.e. 22 + 0 + 0 )
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
No i dont need the decimal value of binary. I need to that as it is as 1's and 0's.
if i have u=1; p=0; q=1;
Then i need result = {u,p,q} = "101" (its neither decimal '5' nor decimal 'one hundred one')
Just i need to concatenate bits.
or else help me how to store binary values and which is the data type for that.
|
|
|
|
|
if you looking for string value as i understand by double quote used by you, you can use sprintf or sprintf_s.
now if you want to store the binary value resulting from you operation (as you mentioned they are only 3 bit coming), you can use char datatype (1 byte) and store the decimal equivalent of it there, internally it store its binary equivalent only,
for say you got 101 which decimal equivalent is 5 and when you store same in char variable, it binary representation would be
00000100
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
But i need to concatenate the bits which are in different variables. how to concatenate those.. Since i cannot use shift operator here because of binary.
|
|
|
|
|
Manoj7390 wrote: i cannot use shift operator here because of binary. What on earth are you talking about? I have shown you exactly how to concatenate these fields into a three bit value. If you really cannot understand that simple operation then I don't think you are going to get very far with this project.
Use the best guess
|
|
|
|
|
Can you please suggest me a program to convert a string into binary, that store in char data type.
|
|
|
|
|
char * p = "101";
char * pEnd;
int val = strtol(p, &pEnd, 2);
char charval = (char)val;
this may fail if p is more than 7 bits long (since that could overflow a signed char).
|
|
|
|
|
I want some help developing a program in C++ that creates course scheduling. Want a start and a good thinking.
|
|
|
|
|
I think you have us confused with rentacoder.
Use the best guess
|
|
|
|
|
No...m not here hiring a coder to do this work for me...just want a expert guidance.. thats it
|
|
|
|
|
Ok, so show us what you've got so far and we'll guide you. Read #2 here.
For starters, what is course scheduling? I can come up with at least a dozen descriptions for that and may not even get close to what you are after. Is this a console application, or does it have a GUI? Will it be reading from a file? What does the output look like?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I think you misunderstand what's on offer here. We can answer specific questions but what you are asking for is far too broad for these forums. You need to go and do some research for yourself and come back here when you have a specific technical question.
Use the best guess
|
|
|
|
|
Rishi S wrote:
I want some help developing a program in C++ that creates course scheduling. Want a start and a good thinking. |
what it your initial analysis about project, like IDE, your initial thinking etc?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Start with the requirements. List them.
Next step: Design the GUI and describe Use Cases, i.e. the different ways you want to allow a user to use your system, and the inputs and outputs.
Then if you need some guidance in implementing the GUI or the processing algorithms, someone here may help you.
|
|
|
|
|
Hi,
i am not able to get objectSid from adsi .i able to get string attributes like cn,DN.. but
hr = ADsGetObject(L"LDAP://CN=nitin n,CN=Users,DC=northwing,DC=Com", IID_IADs, (void**) &pADs );
pUsr->Get(L"objectSid ",&var)
method not working for objectSid. please help me.
Thanks
|
|
|
|
|
venkatesh52867 wrote: pUsr->Get(L"objectSid ",&var)
is it objectSid or just SID?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
|
|
Calling
SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED);
should prevent the system from entering the sleep mode.
Waking a system up requires that the user initiates a wake-up event like pressing the power button, a keyboard key, or moving the mouse.
|
|
|
|
|
Jochen Arndt wrote: Calling
SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED);
should prevent the system from entering the sleep mode.
Its not working in my code..Is there any other method or trick to call it?
Jochen Arndt wrote: Waking a system up requires that the user initiates a wake-up event like pressing the power button, a keyboard key, or moving the mouse.
I want to do it programmatically. Will you suggest something?
|
|
|
|
|
Indian Coder1989 wrote: Its not working in my code..Is there any other method or trick to call it? This is the only way I know. It may help to repeat the call in regular intervals (e.g every 5 minutes).
Indian Coder1989 wrote: I want to do it programmatically. Will you suggest something? There is nothing to suggest because the CPU is usually not powered or in halt state when the system is in sleep mode. There must be an external event to wake-up.
|
|
|
|
|
Jochen Arndt wrote: This is the only way I know. It may help to repeat the call in regular intervals (e.g every 5 minutes).
I made it using a timer and its working now.
Can I do it for a period of time for which my application is running?
Because its only working on a period of my timer.
|
|
|
|
|
I did not really understand what you mean now. Normally, the system should not go to sleep when an application has requested this until the application terminates or clears the state.
But these links may be helpful:
System Sleep Criteria[^]
System Wake-up Events[^]
|
|
|
|
|
Hi, i want to create a code which detect the face in a cercle and put a message indicating the rotation angle of the face or its direction. In fact, my code can just detect the face. The problem that i couldn't found its directions. I'm using win32 console application. can someone help me ?
Thanks !
|
|
|
|
|