How can I do GUI programming in C?

This is guaranteed to have nothing to do with the compiler. All compilers do is compile the code that they are given. What you’re looking for is a GUI library, which you can write code against using any compiler that you want. Of course, that being said, your first order of business should be to … Read more

Using floats with sprintf() in embedded C

Since you’re on an embedded platform, it’s quite possible that you don’t have the full range of capabilities from the printf()-style functions. Assuming you have floats at all (still not necessarily a given for embedded stuff), you can emulate it with something like: You’ll need to restrict how many characters come after the decimal based … Read more

Pause screen at program completion in C

To do this quick hack, the most common two options are: and I suggest the latter method, though the first method really triggers on “any” key while the bottom one only triggers on enter.

Categories c Tags

How does one represent the empty char?

You can use c[i]= ‘\0’ or simply c[i] = (char) 0. The null/empty char is simply a value of zero, but can also be represented as a character with an escaped zero.

Categories c Tags

X86 assembly – Handling the IDIV instruction

The first part of Mysticials answer is correct, idiv does a 128/64 bit division, so the value of rdx, which holds the upper 64 bit from the dividend must not contain a random value. But a zero extension is the wrong way to go. As you have signed variables, you need to sign extend rax to rdx:rax. There is a specific instruction for this, cqto (convert quad … Read more

Excess elements of scalar initializer for pointer to array of ints

The two are only partly equivalent. The difference being that: declares a two-dimensional array, which includes setting aside space for the array and ensuring that daytab references that memory. However: …only declares a pointer. So you’re trying to initialize a pointer with an array initializer, which doesn’t work as expected. There is no array; there’s no memory … Read more

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