You can't just simply write what is in those structres in a file.
The pointers that are there, are pointed to strings, where they only hold the address of the beginnings of the string.
By writing...
Type: Posts; User: BlaX
You can't just simply write what is in those structres in a file.
The pointers that are there, are pointed to strings, where they only hold the address of the beginnings of the string.
By writing...
Hello, I would like to know if there is an efficient way to store data of structures that contain pointers, by using fwrite.
struct names{
char *first;
char *last;
};
All right. My mistake.
As for my question, i know pressing CTRL-D should signal EOF. But my question is, when I input a word, like test for exmple and press CTRL-D, it gets automatically outputed...
Let me clarify what I said in my first post, and where my problem is
Let me again explain to you what my problem is.
When I input test<ENTER>, test gets printed on the other line
test...
Oh you replied in the Linux thread. What do you mean my output is buffered?
I added fflush(stdout) under putchar(c) and the results are the same.
so the code is now
#include <stdio.h>
I didn't get you.
Can you please explain what is happening ?
Hello everyone,
I was trying this very simple piece of code on my Linux machine (running ubuntu 9.10)
#include <stdio.h>
int main(void){
char c;
I've always used Dev-C++ for my coding in C. Couple of days ago I installed Microsoft Visual C++ 2005 Express edition (vers 8).
While including winsock.h I'm getting an error :
fatal error...
As for ...
x is being converted to an int after having 2's complement
0000 0000 0000 0000 0000 0000 1111 1011
or i made a mistake .. is it changed to an int before taking it's 2's compliment ?
And...
Hello there. I was reading this book (C premire) and came up with this
The ranking of types, from highest to lowest, is long double, double, float, unsigned long long, long long, unsigned...
"It cannot be stored in 32 bits" , but im already declaring it as a long long integer and .. why should it post a warning ?
long long x = 18232323232322;
why %I64d .. why isn't %lld...
That's true.The same thing is for the 251 and -5.But why is it printing 251 during char (the +ve value of the variable) and -5 for the int(the -ve value of it) while using the %d format specifier.
...
Ohh .. sorry sorry my mistake.its printing 251.(I know the reason no need to explain.thank you)
But why is the unsigned int not printing 4294967291 and is printing -5 ?
Why should i use the...
Hello everyone.Im having some problem understanding whats going on here ...
This code
unsigned char x;
x=-5;
printf("%d",x);
Operators Associativity
() [] -> . left to right
! ~ ++ -- + - * (type) sizeof ...
thank you all for your answers. i really understood everything you said. Appreciated.
I was wondering .. where do these conversions take place ? im sure they won't be at the memory level...
Let's say that number is stored in a signed char variable x and we want to print it.
printf("%d",x);
should i get -124 or 132 ?
what makes it be -124 or 132 ... knowing that it is a...
Let's say you have a variable int x=-1
=> it is stored as 11111111 in memory ... if we add 1 to x ... how can we determine if the answer is 0 or 256 ?
even the msb won't let us now if...
hey everyone. i had this question going in my mind about negative numbers and how they are stored in memory.i have read that in order to obtain the negative of a number , the 2's compliment is taken...
i was searching for tutorials about sockets in C for windows but didnt come up with something good.can someone advice me a tutorial about this subject?
thank you
that really lightens up all... thank you
so buffers are just arrays .. ?
like if u have int arr[100] arr is a buffer ? (since u said "Usually a buffer means an array of something")
and are...
so functions call use the stack .. that was something i knew .. but lods of new info about the heap and the buffer .. but the image is still vague
where are these things found in ? are they all in...
a bit ago i was searching about buffers , heaps and stacks .. trying to find out what each of one does . but unfortunately i got confused so decided to come hear and ask u guys .. what does each one...
a bit ago i was searching about buffers , heaps and stacks .. trying to find out what each of one does . but unfortunately i got confused so decided to come hear and ask u guys .. what does each one...