Example #1
0
struct node *sort(struct node *start,float n,int pos)
{
	typedef struct node node;
	node *temp,*p;int i;
	p=start;
	for(i=1;i<pos-1&&p!=NULL;i++)
	p=p->next;
	temp=(node*)malloc(sizeof(node));
	printf("ENTER NAME, POSITION,AGE\n");
	scanf("%s%s%d",temp->name,temp->pos,&temp->age);
	temp->d=fun(start1);
	temp->ph=pun(start2);
	temp->sal=n;
	if(pos==1)
	{
		temp->next=start;
		start=temp;
	}
	else
	{
		temp->next=p->next;
		p->next=temp;
	}
	return start;
}
Example #2
0
SkPDFUnion SkPDFUnion::copy() const {
    SkPDFUnion u(fType);
    memcpy(&u, this, sizeof(u));
    switch (fType) {
        case Type::kNameSkS:
        case Type::kStringSkS:
            new (pun(u.fSkString)) SkString(*pun(fSkString));
            return u;
        case Type::kObjRef:
        case Type::kObject:
            SkRef(u.fObject);
            return u;
        default:
            return u;
    }
}
Example #3
0
SkPDFUnion::~SkPDFUnion() {
    switch (fType) {
        case Type::kNameSkS:
        case Type::kStringSkS:
            pun(fSkString)->~SkString();
            return;
        case Type::kObjRef:
        case Type::kObject:
            SkSafeUnref(fObject);
            return;
        default:
            return;
    }
}
Example #4
0
struct node *kaushal(struct node *start)
{	
	typedef struct node node;
	int key=1,count=0;node *p;
	float n;
	if(start==NULL)
	{
		/*d=(struct dep*)malloc(sizeof(struct dep));//node *temp;*/
		temp=(node*)malloc(sizeof(node));
		printf("ENTER NAME, POSITION,AGE,SALARY\n");
		scanf("%s%s%d%f",temp->name,temp->pos,&temp->age,&temp->sal);	
		temp->d=fun(start1);
		temp->ph=pun(start2);
		temp->next=NULL;
		start=temp;
	}
	/*p=start;*/
	printf("to continue press 1");
	scanf("%d",&key);
	if(key==1)
	{
		while(key==1)
		{
			
				p=start;
				printf("Enter salary");
				scanf("%f",&n);
				while(p->next!=NULL)
				{
					
					if(p->sal>n)
					{
						count++;
						start=sort(start,n,count);
						count=0;
						break;
					}
					count++;
					p=p->next;
				}
					
					
						if(p->next=NULL)
						{
											
						temp=(node*)malloc(sizeof(node));
						printf("ENTER NAME, POSITION,AGE\n");
						scanf("%s%s%d",temp->name,temp->pos,&temp->age);
						temp->d=fun(start1);
						temp->ph=pun(start2);
						temp->sal=n;
						temp->next=NULL;
						p->next=temp;
						}
			
				printf("to continue press 1");
				scanf("%d",&key);
			
		}
	}
	else
	return start;
	return start;
}