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)...
Type: Posts; User: k_w_s_t_a_s
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)...
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:...
I wrote the following code:
/* prs.c */
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
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.
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}
How can I use(know) in my programs the size of the block that the operating system is using?
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...
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...
I wrote the following progs:
/* prsref.c */
#include <sys/types.h> /* For sockets */
#include <sys/socket.h> /* For...
Thanks salem.It worked.
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>...
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...
when i run :
printf("%d",sizeof(short));
it prints 2 but when i run the program with the struct it prints 8.
I'm running the following prog :
#include <iostream>
using namespace std;
struct customer {
short number; // 1:
The sizeof(short) is 2 not 4.
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?
I'm running the following prog :
#include <stdio.h>
struct customer {
short number; // 1:
Is there a way(with new) to allocate a number of bytes which will be initialised to zero like calloc in C?
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...
"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?"...
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...
I am sorry I insist but isn't there anybody who can give some advice for a non-recursive solution?
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>?
I tested it and it doesn't print anything.
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.