What is the source of the data for the ProgramFiles, ProgramW6432Dir, ProgramFilesDir (x86), CommonProgramFiles environment variables?

On a 64-bit Windows system, the reading of the various environment variables and some Windows Registry keys is redirected to different sources, depending whether the process doing the reading is 64-bit or 32-bit. The table below lists these data sources: So for example, for a 32-bit process, the source of the data for the %ProgramFiles% and %ProgramFiles(x86)% environment variables is the … Read more

How does the strtok function in C work? [duplicate]

I found this sample program which explains the strtok function: However, I don’t see how this is possible to work. How is it possible that pch = strtok (NULL, ” ,.-“); returns a new token. I mean, we are calling strtokwith NULL . This doesen’t make a lot sense to me.

Why is the sizeof(int) == sizeof(long)?

A long, as far as I know, is 8 bytes. Is this correct? No, this is not correct. The C and C++ specifications only state that long must be greater than or equal to 32 bits. int can be smaller, but on many platforms, in C and C++, long and int are both 32 bits. This is a very good reason … Read more

C printing bits

You are calculating the result correctly, but you are not printing it right. Also you do not need a second loop: If you’d like to show off, you could replace the conditional with two exclamation points:

Categories C Tags

‘sprintf’: double precision in C

From your question it seems like you are using C99, as you have used %lf for double. To achieve the desired output replace: with The general syntax “%A.B” means to use B digits after decimal point. The meaning of the A is more complicated, but can be read about here.

Categories C Tags

What are .axf files?

The AXF file is an object file format generated by ARM’s RealView compiler (also part of Keil’s ARM-MDK) and contains both object code and debug information. In the debugger, while just the object code is loaded on the target itself, both the code and the debug information are loaded in the development host’s memory. When … Read more

How to find EOF through fscanf?

fscanf – “On success, the function returns the number of items successfully read. This count can match the expected number of readings or be less -even zero- in the case of a matching failure. In the case of an input failure before any data could be successfully read, EOF is returned.” So, instead of doing … Read more

gcc -g :what will happen

That’s kind of right, but incomplete. -g requests that the compiler and linker generate and retain source-level debugging/symbol information in the executable itself. If… the program happens to later crash and produce a core file (which suggests some problem in the actual code), or a deliberate OS command forced it to core (e.g. kill -SIGQUIT pid), or the program … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)