Amit Khatri
BAN USERIt is better to have setsockopt() function after socket creation....
- Amit Khatri September 07, 2013Both process has a different virtual address space. If you send address of a function from process A to process B, in process B address from A does not make any sense. The memory mapping in process A will be different from that in process B. If you want to do so u need to know the memory mapping of process A and according to that you need to deference the memory in process B.
- Amit Khatri September 07, 2013#include<stdio.h>
void main()
{
int num = 0x25,i;
for(i=0;i<4;i++)
{
num = num << 8 | num;
}
printf("%X",num);
}
struct node{
int info;
struct node *leftch;
struct node *rightch;
};
int AppendInBST(struct node **start, int num)
{
struct node *ptr,*tmp,*par=NULL;
tmp = (struct node*)malloc(sizeof(struct node));
tmp->info = num;
tmp->leftch= NULL;
tmp->rightch = NULL;
ptr = *start;
while(ptr != NULL)
{
par = ptr;
if(num > ptr->info)
ptr = ptr->rightch;
else if(num < ptr->info)
ptr = ptr->leftch;
else{
printf("Duplicate Entry\n");
return 0;
}
}
if(par == NULL)
{
*start = tmp;
}
else if(par->info > num)
par->leftch= tmp;
else if((par->info) < num)
par->rightch = tmp;
return 1;
}
it will not check if first element is non-repeating. ex "asssxxxxwwwwww"
add condition for first element.
better implement stack and add each word in stack at the end pop each word.
- Amit Khatri July 07, 2013Graph for storing the location of city and also a flag which is set if a city having there weather station. Hash_map for storing weather report of city having there own weather station if any city don't have there weather station its value will be NULL (or any ).
Now check the city in graph if it have weather station then go to has table to find the weather report. If not check the nearest city having weather station.
In place of taking int array it is better to take char array...............
- Amit Khatri January 18, 2014