Thread: incompatible types in assignment

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    46

    incompatible types in assignment

    following is main function of my program
    Code:
    #include<stdio.h>
    #include"header.h"
    
    main()
    {
        unsigned char crc;
        unsigned char ar;
        pdt pv;
        adt av;
        frame *f1;
        frame fr;
        
        int src1=0;
        int dest1=1;
    
        av.ack=9;
        
    //opens a file and assigns a file descriptive to fp
        fp=fopen("txtfile","r");
    
       //generates stuffed information
       stuff(&pv,fp);
       
        //creates the control byte
        control_byte(&pv);
    
        //crc is generated for the information
        crc=crc_gent(&pv);
    
        //frame is created..
        f1=(frame *)make_frame(&pv,crc,src1,dest1);
        
        //push that frame into a buffer
        push(f1);
        
    //check for the acknowledgement from the receiver side
        ar=ack_check(&av);
    
    //sliding window is created...
        fr = slide(512,ar); //incompatibe type in assignment
    }

    my header file is
    Code:
    #include<stdio.h>
    //typedef int frame_type;
    
    FILE * fp;
    
    typedef struct payload {
    	int frm_typ;
    	unsigned char cb;
    	unsigned char stuf_info[5];
    }pdt;
    
    typedef struct frame {
    	char st_flag;
    	int src_addr;
    	int dest_addr;
    	pdt p;
    	unsigned char crc;
    	char end_flag;
    }frame;
    struct frame f4[512];
    
    typedef struct ack_frme
    {
    char st_flg;
    int src_addr;
    int dest_addr;
    unsigned char ack;
    char end_flg;
    }adt;
    i have problem in
    fr = slide(512, ar);


    slide function is returning a frame..
    but for that line its giving error as incompatible types in assignment.
    Last edited by vapanchamukhi; 09-18-2008 at 10:23 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Incompatible types in assignment.
    By killpoppop in forum C Programming
    Replies: 36
    Last Post: 12-22-2008, 12:08 PM
  2. assignment from incompatible pointer types
    By iunah in forum C Programming
    Replies: 13
    Last Post: 10-12-2008, 03:32 AM
  3. incompatible types in assignment
    By vapanchamukhi in forum C Programming
    Replies: 1
    Last Post: 09-18-2008, 11:35 PM
  4. The Interactive Animation - my first released C program
    By ulillillia in forum A Brief History of Cprogramming.com
    Replies: 48
    Last Post: 05-10-2007, 02:25 AM
  5. Incompatible types in assignment error
    By Zildjian in forum C Programming
    Replies: 12
    Last Post: 10-03-2003, 01:15 PM