Thanks sorry for the edit...
Type: Posts; User: MKirstensen
Thanks sorry for the edit...
So you mean that when i use buff in memset function for example, the compiler already looks at it as a pointer to the mem block, but when u uses the * it just points to the first section in the array?
In know, but cant find a damn thing on this particular subject.... im sorry.
Still bee nice if someone would answer me on what the consequences for a string without NULL is...
To me its looks...
What happens without the NULL.
Will it pickup data from memory until next NULL?
And when i do the:
str2[3] = "\0";
Get: warning: assignment makes integer from pointer without a cast
Dont i need to add the NULL?
Hello World!
If now i want to take the 3 first chars in a string, to compare them to something else.
How do i easiest only get those 3 chars of the string when i want to compare?
Thanks!
There is something i dont get :confused:
When i call the function:
nameOfFunction(str, sizeof(str));
Why isnt there & in front of str, cause it seems logical to me that you passes the...
What is a static variabel? and whats is void?
Simple question: How can i make a function return a string?
I have tried this:
char "name of function"(Arguments) {
char string1[16];
string1 = "Hello World";
return string1;
}
Thanks alot...
Hello World!
In the sockaddr_in structure...
struct sockaddr_in {
short int sin_family;
unsigned short int sin_port;
struct in_addr ...
Thx...
Hello World!
When i call inet_addr(string containing vaild ip address), i get back int back.
Like:
printf("%d\n", inet_addr("192.168.0.1"));
/* The result is: 16820416 */
Ohhh yearh........ Sorry stupid question :)
Hello World!
Structure.member
Okay here is the deal: i get that with this i statement i can reach the value "member" associated the single structure "structure". But when the statement looks...
Why is the result not 1?... :confused:
So i places the value of &my_addr in the struct sockaddr memory block.... right? and whats i the "*" good for? :confused:
I THINK i get it now, it makes &my_addr act like struct sockaddr * , but how can a memory address act like a structure ? :confused:
Thx alot! Elysia
So it takes the address of my_addr and place it in the structure sockaddr... Am i right?
Hello World!
(struct sockaddr *)&my_addr
What does this line do?... I am still trying to learn C :)