|
How about this? Do i do it correctly,
unsigned int a,b,c;
void main()
{
a=10;
b=7;
c=a>>5;
b=c|a;
a=~c&~b;
c=b*a^5;
}
end
I know >> is greater than. * is square and ^ xor.
The command like "|" and "~" i really not familiar with. Can anyone explain or go through with it. What it will be the final value for a, b and c? I really confused
|
|
|
|
|
Member 4099222 wrote: c=a>>5;b=c|a; a=~c&~b; c=b*a^5;
WTF are you trying to achieve with this ?
why don't you just listen to the answers you get, try to understand them, and fix your code the simple way people just told you ?
your parameters to printf() are in the wrong order dude !
your code is making the addition of c = a + b , but you want to print c + b = a ... WTF !
what you do (the wrong thing):
printf("%d+%d=%d\n", c, a, b);
what you should do (the good thing):
printf("%d+%d=%d\n", <code>a, b, c</code>);
|
|
|
|
|
Hi,
I wanted to save HDC into a file(*.jpg). How can I do this?
I will appreciate your reply.
Thanks.
|
|
|
|
|
I'm quite new in this stuff and wonder how can I send a file to an eMail address ...
Maybe It's a funny question, but I should go ahead!
Thank you masters!
|
|
|
|
|
|
Hi masters!
--------------
Whenever I try to find drive types and their letters using GetDriveType(), FindFirstVolume() and also FindNextVolume(), I get an odd string like this:
//?/a12c-abb14d-acbb0252-dda525/
as the name of founded drives ...
How can I find drive types and letters (Something like: D:\, C:\, ...) on a given system?
Thank you masters!
modified on Tuesday, September 23, 2008 4:00 PM
|
|
|
|
|
To list the available volumes, use GetLogicalDriveStrings()[^]. Then, for each drive path returned, then use GetDriveType().
Regards,
--Perspx
"I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
"Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds
|
|
|
|
|
Thank you so much
Thank you masters!
|
|
|
|
|
Jusef Marzbany wrote: How can I find drive types and letters (Something like: D:\, C:\, ...) on a given system?
See here.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Thank you very much
Thank you masters!
|
|
|
|
|
Hi masters!
--------------
Say we wanna call SetTimer(); As you know (or had better to know ), one of Its parameters is pointer to a function to be called after a certain time is elapsed (that's a call-back function).
how can I define a member function to pass to it?
I tried the following methods, but I got an/some error/s in both cases:
1- SetTimer( ..., &CMyclass::MemberFunction);
2- SetTimer( ..., Memberfunction);
unfortunatly I don't remember the exact error/s now and I'm not home to reffer to my project ...
I'm using VS 2005
Thanks in advanced ...
|
|
|
|
|
Jusef Marzbany wrote: how can I define a member function to pass to it?
By making it static .
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
thank you
Thank you masters!
|
|
|
|
|
You can't, except if the function is a static function. Because member functions and non-member functions do not have the same prototype (for the member functions, there's an implicit 'this' parameter).
|
|
|
|
|
Thank you for your reply But I got another question:
You meant static functions doesn't have this within them?
Thank you masters!
|
|
|
|
|
Because they're class methods (instead of instance ones). Since a static method cannot access instance data, it does NOT need the this pointer.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Ur a hereo
Thank you masters!
|
|
|
|
|
Jusef Marzbany wrote: Ur a hereo
Thank you, whatever it means
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
I need to be able to toggle the handshaking lines on the serial port.
Can anyone help with this.
I am using vc6 on XP.
Cheers
Jim
|
|
|
|
|
|
Thanks for that, I'll give it a go.
I'll let you know how I get on.
Cheers
Jim
|
|
|
|
|
I need some help creating a unix shell using c++. Can anyone help me out here. Starting from scratch.
#include <iostream>
using namespace std:
Are the only includes I have so far. Code wise I have started it but no clue where should I end up.
|
|
|
|
|
crain1981 wrote: #include <iostream>
using namespace std:
Are the only includes I have so far. Code wise I have started...
Wow. Other than the syntax error, you're almost done!
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
lol.... glad you pointed that out...
so:
#include <iostream>
using namespace std;
Is this better.
Anyhow I'm trying to code the unix command cd in C++. Any pointers.
|
|
|
|
|
crain1981 wrote: Anyhow I'm trying to code the unix command cd in C++. Any pointers.
Try SetCurrentDirectory() .
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|