no, it's just that i've done this a few times, so it's no problem for me. but at least some minutes ago, as i understood it, you failed to see how it could be done.
likewise, for keyboard handling, if the keyboard didn't do auto-repeats itself, then GetMessage could have synthesized WM_KEYDOWN and WM_KEYUP. it would simply note that there's a WM_KEYDOWN alone in the queue, with old timestamp.
to do this at application level one just needs to discard (ignore) the real keyboard auto-repeats, which is easy.
i have one string , string str = "101010" , i want to store this value in any variable in bits so we save some memory . because we save this string in bits insted of bytes
@AlfPSteinbach i have one string , string str = "101010" , i want to store this value in any variable in bits so we save some memory . because we save this string in bits insted of bytes
@cHao i have one string , string str = "101010" , i want to store this value in any variable in bits so we save some memory . because we save this string in bits insted of bytes
@saurabh_k if you want to convert easily from a string of "101010" to integer (say), you can use a std::bitset. as I recall it has a constructor taking a string. and some method that gives you the integer value.
@saurabh_k oh sorry i answered as if you were asking about C++. in the C language, you'll have to code up a loop, computing the integer value.
@AlfPSteinbach thanx a lot so first of all i have to convert that binary value to decimal and store that decimal value to any variable so i can reduce memory size
@cHao dear i have a character pointer that points to this type string
@saurabh_k there is no decimal representation involved, so i'm not sure what you mean. using std::bitset is an easy way to convert to integer. however, if your strings can be arbitrary length (arbitrary number of zeroes and ones) then you'd better use a std::vector<bool> or something. std::vector<bool> is optimized to use just 1 bit per value.
@AlfPSteinbach thanx a lot but see, i have different different string array which contains all binary type strings only 0 and 1. but they all occupy 1 bye for each 1 and 0 so i want to convert them in to bits and save to different array which contains only bits. for example str[50] = "1001" here str [50] occupy 4 bytes but i want to store this 1001 string in bits and optimized to 1 bye. my main goal is this... And one thing std::vector<bool> and std::bitset is for C or C++?? i want this thing in C..
@user654842 think about this: at best you're talking about a factor of 8 saved, for very small amount of data. the complication isn't worth it. however, if it is a requirement of homework assignment, then I suggest starting with simple exercises converting an integer to binary representation in string, and vice versa. Like, define a function foo such that foo(42) returns a pointer to malloc-ed string "101010".
@Potatoswatter You can use callgrind and then vizualize the results using kcachegrind. On Mac OS X I use a native callgrind build and use VirtualBox Linux to create the visualized output with kcachegrind. (Native kcachegrind on Mac doesn't work well, I don't remember which issues I had exactly.)
@Potatoswatter Btw, on Mac you can use Shark as well.
Been better. Actually I've moved to Southeast Asia for a few months to try and save money. So my understanding is MG and me both have some weird accommodations.
Hi, I'm confused what's the difference between a File descriptor and pointer in C? For example `FILE * fp = fopen("filename.txt","w+") ;` Does that actually create a file object and returns the pointer to the object?
Apparently FILE is a wrapper....that holds the file descriptor...
You're just supposed to treat a FILE* as an opaque handle. The system might just treat the address stored in the pointer as a unique identifier which can be used to look up the file information in the system's own data structures
the pointer to the struct. I haven't looked at how FILE is actually defined, but it need not contain anything
A FILE* doesn't even have to point to an allocated FILE struct. It might just be a unique integer key casted into a pointer value
that's how Windows' handles work
To the type system they're pointers, but they don't point to anything, and you can't meaningfully dereference them. They're just unique keys that the OS can use to look up data in its internal data structures
There's no reason for them to be. They don't point to anything in your own process' address space. They identify abstract/system-level resources. If you had a pointer to the actual data structure associated with an open file, for example, then that would allow you to overwrite it and corrupt it. No one wants that
so instead you get something that looks like a pointer, but which doesn't really point to anything
I believe handles are something like struct HANDLE { void * actualPtr; };. But the API only exposes a forward declaration to the HANDLE struct so you can't access the real pointer.
@RMartinhoFernandes sure can, just come up with a reasonable upper bound estimate. I bet it's less than 2MB, so memcpy'ing 2MB of data starting with its start address is sure to get the sucker ;)
and if they decide against me, which is quite ridiculous, there are independent complaints procedures
the thing is, when you start listing everything, then it's actually quite insane and obviously going to go wrong.
like
"Oh hey, we won't release your results, so if there's a problem, you can't sort it out, because we won't tell you about it! Also, we won't release your results because there's a problem with your finance, but the finance office can't sort it out! Also, the only guy who can isn't in the office. No, we won't leave him a message."
Heres the deal. I tired to wait Flash on Windows Phone 7 so i desided to create my own flash player for this phone.
If anybody can help me and give some info about Flash, how it works (iternals), how to create one, any advices about codes, audio, video ect.
I can promise two things - this progr...
@StackedCrooked No. "Moonlighting" is the job of that guy who lights the moon every night (unless it's cloudy). I dunno whether he pays his income tax, though.
the degree of sloppyness at an organization is usually directly proportional to the amount of effort they're willing to put into fighting against complaints
@StackedCrooked It kind of is, actually. My father works as an Ombudsman for the financial industry. My mother worked for Trading Standards. My sister just graduated from a top university, doing Law.
uh, Ombudsmen are like, mini-judges that specialize in small areas, they exist to hand down legal judgements and be cheaper than a full court
and Trading Standards is a consumer complaints thing about e.g. buying products and they break in 1second