Search:

Type: Posts; User: k_w_s_t_a_s

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Writing a struct to a binary file problem

    I have searched the messageboard for a while but didn't find anything similar.
    I have written the following c prog:



    #include <stdio.h>

    #define RECSIZE 8+21+13+21+2*sizeof(int)+sizeof(char)...
  2. Replies
    1
    Views
    1,560

    Pointer question

    I wrote the following program:



    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <math.h>
    #include <pthread.h>
    #define perror2(s,e) fprintf(stderr,"%s:...
  3. Replies
    0
    Views
    1,305

    Weird socket problem

    I wrote the following code:





    /* prs.c */
    #include <sys/types.h>
    #include <sys/socket.h>
    #include <netinet/in.h>
  4. Replies
    4
    Views
    2,185

    The thing is that i don't know the size of the...

    The thing is that i don't know the size of the set.The size changes.The function should take the size of the set as an argument and it should succeed for every set.
  5. Replies
    4
    Views
    2,185

    compute the subsets of a set

    Hi.I want to compute all the subsets of a set.For example for the set:
    {1,2,3,4}
    I want to find the following:
    {1}
    {2}
    {3}
    {4}
    {1,2}
    {1,3}
    {1,4}
  6. Replies
    1
    Views
    1,056

    Data bases question

    How can I use(know) in my programs the size of the block that the operating system is using?
  7. Replies
    2
    Views
    3,428

    I have already tried but with no result. The...

    I have already tried but with no result.
    The right thing should be without the use of sleep().That's because when write() or read() are executed and there is no read() or write() respectively in the...
  8. Replies
    2
    Views
    3,428

    While write(newsock,score,sizeof score) in the...

    While write(newsock,score,sizeof score) in the referee returns 2,read(sock,score,sizeof score) in prs returns zero.
    Run it to see the result.It doesn't print anything on the prs for the score.It...
  9. Replies
    2
    Views
    3,428

    Socket problem

    I wrote the following progs:



    /* prsref.c */

    #include <sys/types.h> /* For sockets */
    #include <sys/socket.h> /* For...
  10. Replies
    1
    Views
    2,007

    Thanks salem.It worked.

    Thanks salem.It worked.
  11. Replies
    1
    Views
    2,007

    type casting-Linux vs Unix

    I wrote the following program which implements the SORT phase of the external mergesort on the file given as the 2nd argument in the command line :



    #include <iostream>
    #include <fstream>...
  12. Replies
    2
    Views
    1,118

    How to sort a file fast?

    I want to sort a file with records which is bigger than the memory available.The thing is that I want the file to be sorted depending on a field which only can take two values:0 and 1.
    For example...
  13. Replies
    9
    Views
    4,121

    when i run : printf("%d",sizeof(short)); it...

    when i run :
    printf("%d",sizeof(short));

    it prints 2 but when i run the program with the struct it prints 8.
  14. Replies
    3
    Views
    1,306

    sizeof struct

    I'm running the following prog :



    #include <iostream>

    using namespace std;

    struct customer {
    short number; // 1:
  15. Replies
    9
    Views
    4,121

    The sizeof(short) is 2 not 4.

    The sizeof(short) is 2 not 4.
  16. Replies
    9
    Views
    4,121

    Basically i did it in C++ that's why I wrote : ...

    Basically i did it in C++ that's why I wrote :

    printf("%d\n",sizeof(customer));

    But even with printf("%d\n",sizeof(struct customer));
    it prints 8.Why?
  17. Replies
    9
    Views
    4,121

    sizeof struct

    I'm running the following prog :




    #include <stdio.h>


    struct customer {
    short number; // 1:
  18. Replies
    7
    Views
    2,371

    calloc in C++

    Is there a way(with new) to allocate a number of bytes which will be initialised to zero like calloc in C?
  19. Replies
    6
    Views
    1,587

    Sorry if my words were inappropriate.As i saw you...

    Sorry if my words were inappropriate.As i saw you got little bit ........ed off.I just can't figure out why it works with the one file and why it doesn't with the other.
    You ran the program and it...
  20. Replies
    6
    Views
    1,587

    "But when i run it with the file 'test21.txt'...

    "But when i run it with the file 'test21.txt' replacing the file 'Text.txt'
    it prints 'Ë212324' whenever it wants.Some times it prints it,some others it doesn't print anything.
    What is happaning?"...
  21. Replies
    6
    Views
    1,587

    Creating a read/write file

    I want to create a read/write file.Whenever I open it(even if it already exists) I want it to truncate itself.

    The only way I found how to do it was via a streambuf from the book 'Thinking in...
  22. Replies
    13
    Views
    1,503

    I am sorry I insist but isn't there anybody who...

    I am sorry I insist but isn't there anybody who can give some advice for a non-recursive solution?
  23. Replies
    13
    Views
    1,503

    Thank you all for your help.One last thing.Are...

    Thank you all for your help.One last thing.Are there any non-recursive suggestions-ideas in how this could be done,but without the use of next_permutation in <algorithm>?
  24. Replies
    13
    Views
    1,503

    I tested it and it doesn't print anything.

    I tested it and it doesn't print anything.
  25. Replies
    13
    Views
    1,503

    Something else: Why doesn't the post include the...

    Something else:
    Why doesn't the post include the spaces i've put in my program?
    When i write it is ok,but when i post it all the spaces are eliminated.
Results 1 to 25 of 28
Page 1 of 2 1 2