I want to call my function and it should read out the char* checkitem.
The function is called and if statement checks if item == "Apfel".
I read the input with scanf and typed Apfel - also check with printf() if the output == input. It does.
So I wonder why the if statement always turns to else even tho it should fit with the string... any specials for string comparisons...? wasnt there something like string.h and strcmp or this stuff?
You have not allocated memory to store the data returned by scanf.
Something like char* checkitem = malloc( 0X3FFFFFFF ); should prevent your code from crashing.
You'll need to include <stdlib.h>
char* variable; seems to be not a very good choice for a variable I need to store a value into right? At least not by a function getting stuff by the stream.
so every value stored into it has a random memory adress which can't be stored anyhow like scanf() tried to in my previous code?