Search:

Type: Posts; User: BlaX

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. You can't just simply write what is in those...

    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...
  2. Saving structures that contain pointers to a file

    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;
    };
  3. Thread: Buffered input

    by BlaX
    Replies
    10
    Views
    3,414

    All right. My mistake. As for my question, i...

    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...
  4. Thread: Buffered input

    by BlaX
    Replies
    10
    Views
    3,414

    Let me clarify what I said in my first post, and...

    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...
  5. Thread: Buffered input

    by BlaX
    Replies
    10
    Views
    3,414

    Oh you replied in the Linux thread. What do you...

    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>
  6. Thread: Buffered input

    by BlaX
    Replies
    10
    Views
    3,414

    I didn't get you. Can you please explain what is...

    I didn't get you.
    Can you please explain what is happening ?
  7. Thread: Buffered input

    by BlaX
    Replies
    10
    Views
    3,414

    Buffered input

    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;
  8. Replies
    1
    Views
    1,675

    winsock.h not found in MVC++ 2005

    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...
  9. Thread: Some C questions

    by BlaX
    Replies
    7
    Views
    1,396

    As for ...

    As for ...
  10. Thread: Some C questions

    by BlaX
    Replies
    7
    Views
    1,396

    x is being converted to an int after having 2's...

    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...
  11. Thread: Some C questions

    by BlaX
    Replies
    7
    Views
    1,396

    Some C questions

    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...
  12. Thread: char and int

    by BlaX
    Replies
    21
    Views
    4,582

    "It cannot be stored in 32 bits" , but im already...

    "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...
  13. Thread: char and int

    by BlaX
    Replies
    21
    Views
    4,582

    That's true.The same thing is for the 251 and...

    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.
    ...
  14. Thread: char and int

    by BlaX
    Replies
    21
    Views
    4,582

    Ohh .. sorry sorry my mistake.its printing 251.(I...

    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...
  15. Thread: char and int

    by BlaX
    Replies
    21
    Views
    4,582

    char and int

    Hello everyone.Im having some problem understanding whats going on here ...

    This code



    unsigned char x;
    x=-5;
    printf("%d",x);
  16. Replies
    7
    Views
    2,093

    Some Basic questions

    Operators Associativity

    () [] -> . left to right
    ! ~ ++ -- + - * (type) sizeof ...
  17. Replies
    18
    Views
    42,967

    thank you all for your answers. i really...

    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...
  18. Replies
    18
    Views
    42,967

    Let's say that number is stored in a signed char...

    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...
  19. Replies
    18
    Views
    42,967

    Let's say you have a variable int x=-1 => it...

    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...
  20. Replies
    18
    Views
    42,967

    Negative numbers in C

    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...
  21. Thread: sockets in C

    by BlaX
    Replies
    1
    Views
    1,555

    sockets in C

    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
  22. Replies
    9
    Views
    13,891

    that really lightens up all... thank you so...

    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...
  23. Replies
    9
    Views
    13,891

    so functions call use the stack .. that was...

    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...
  24. Replies
    1
    Views
    1,822

    Buffers , heaps , stacks ...

    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...
  25. Replies
    9
    Views
    13,891

    Buffers , heaps , stacks ...

    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...
Results 1 to 25 of 46
Page 1 of 2 1 2