They both do the same,
But some people use <constant>==<variable> condition because in case you replace == with =, you can easily identify it.
Type: Posts; User: doraiashok
They both do the same,
But some people use <constant>==<variable> condition because in case you replace == with =, you can easily identify it.
Still there is problem with the code below,
#include <stdio.h>
#include <stdlib.h>
int main(void){
char c;
I am pleased to help you and please ask any more doubts in files ,linked list or any other thing in C.
Thanks
With SO_ATTACH_FILTER you will have to specify the filter code but i want to block all IP packets and send only the packets, which may be useful.
(Definition of useful may be dependent on data...
The code below will work, Try it.
void add_odd_in_lefe_linked(ptr *head)
{
ptr p,q,r,prev;
for(q=(*head);q->next!=NULL;q=q->next);
//q contains the last element
prev=NULL;
This code will work.
void del_freq(ptr *head)
{
ptr p,q,prev,prev1;
int flag = 0;
for(p=*head;p!=NULL;p=p->next )
{
Analysis of the allocation statement:
entpairs[i].key = (char*) malloc(MAX_ENTITY_KEYLENGTH*sizeof(char));
In the code above, i don't think there can be anything wrong to the right hand...
Could you please attach the entire code. I will try to debug it and give you back.
Thanks.
Sorry, I forgot that but if you do this, the p = p->next in the outer for-loop has to be removed. So the code now looks as below,
void del_freq(ptr *head)
{
ptr p,q,r;
...
Input:
1->2->1->3->2->1->4
Output:
3->4
The code below does above,
I had by mistake posted in the C programming board,
http://cboard.cprogramming.com/showthread.php?s=&threadid=48181
Please take a look at the link and help me out.
Thanks.
Which platform are you using, MS-Windows or Linux.
In Linux, You have to use CURSES Library
In MS-Windows, varies from compiler to compiler.
So tell about the platform you are using.
Adding q=p; in the code (see below) should do,
void del_freq(ptr *head)
{
ptr p,q;
for(p=*head;p!=NULL;p=p->next)
{
for(q=p->next;q!=NULL;q=q->next)
Since the project is in the test level, there are only two computers in the network which are connected via a hub.
To test the simple packet filtering, this is what was tried?
Test Case :
...
The || has to be replaced with && as below,
while(gameCh != 1 && gameCh != 2 && gameCh != 3 && gameCh != 4);
When a double value is assigned to an integer variable, the fractional part automatically gets truncated .i.e., only the integer part goes into the variable. (See example below)
double...
As a part of my project i have to use UNIX socket programming to discard IP packets coming from a particular IP address.
So what i did was, I created a socket as follows,
int sockfd;...
great explanation!!!!
Thanx a lot.
The sample code below uses comma operator,
#include <stdio.h>
int inc(int i)
{
return ++i;
}
Please Indent the code next time when you upload,
some of the errors are
1) character variable cannot be initialized to NULL pointer
s.homec = '\0'; // NULL is used only to initialize...
It is always better to print the error messages to error output as in the code below,
if( in == NULL)
{
fprintf(stderr,"\nUnable to open the source file.");
return 1;
}
There are 3 logical errors in the code,
1) Variables QL, QD, QP, QS, QO are to be initialized to 0, since you are using it in the later part of the program.
2) I don't understand the...
sorry about that 'lengthystring[i]' missing
As prelude has already explained in the other thread, you can use scanf as follows,
for(i=0;i<=5;i++)
{
scanf(" %[^\n]",lengthystring[i])
}