Because I didn't know.
Type: Posts; User: ThatDudeMan
Because I didn't know.
Is it possible to read numbers from the console as addresses then?
The user inputs a number in the console, which is to be interpreted as an address.
I then have to lookup what is at that address and tell him.
Hello,
I am casting an integer value to a pointer. It works without problems on systems where sizeof(int) == sizeof(pointer)
But on systems where this is not the case, I am getting a compiler...
No,
I want to know the known reasons why an array is initialized with 0s in one program and the same one is initialized with numbers in the same program, but newer version.
I am pretty sure now...
Hello,
I have a character array with 14 elements in my newest version of my program. The same character array is on the same spot in my old version of the program.
The differences are: On my old...
Hello,
is it possible to check the address a pointer points to? I am writing a program where a user can enter an address in hex format and I have multiple pointers in my program pointing to...
I figured out that in the 2nd example some of my m3 elements override some m2 elements.
Why?
/edit: nvm
Hello,
first the code that works:
int main(int argc, char *argv[])
{
When I input a string with less chars and compare it with strcmp, it doesn't recognize it, what's wrong?
Let's say my size in fgets is 12, what happens when I input a String with 6 chars? What does it put in my char* variable I pass?
fgets has a size parameter which is troubling me.
So, how do I read strings with variable length and spaces?
The problem with fgets though is that I can't read input with variable length.
But fgets reads a file?
As I said, it fails on spaces. Apparently strcmp can only handle letters?
I want to check for equality. Equality being same characters on same positions.
Hello,
when I want to compare strings with spaces, strcmp fails on me :/ . Is there an alternative function that tests strings for equality that can also handle spaces?
Or what other way should I...
Hello,
when I was trying to compile my program under linux with gcc, my main file got deleted(with the main function in it) and it gave me a compile error, because the main function was gone....
Oh yeah, I have to compile all source files at once, that was my mistake.
Hello, I defined the function in a file called mytype.c which includes mytype.h.
How do I get it from there?
Hello,
I have a problem. When trying to compile my sourcecode I get following warning:
undefined reference to `add'
This is where I get it:
#include <stdio.h>
Hello,
I want to show the date when my program was compiled on my local machine.
For example it shows "Version 1.01, compiled at 'date'". Is there some way to get the date when my program is...