HELP please - incompatible types in assignment

Discussion in 'C Programming' started by dannydb368, Mar 15, 2009.

  1. dannydb368

    dannydb368

    Joined:
    Mar 15, 2009
    Messages:
    1
    Hello. My name is Martin. I was wondering if someone could please help me out. The problem is that when i compile this function i get an error message saying the following:

    In Function handle_delete:
    p6-server.c:184: error: incompatible types in assignment
    p6-server.c:185: error: incompatible types in assignment
    p6-server.c:186: error: incompatible types in assignment

    This is my program:

    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <string.h>
    #include <time.h>
    #include "net.h"
    #include "p6.h"


    #define MAX_MESSAGES 10
    #define MAX_USERS 10

    struct message {
    char from[STR_LEN];
    char date[STR_LEN];
    char message[MSG_LEN];
    };

    struct user {
    char name[STR_LEN];
    int num_msgs;
    struct message messages[MAX_MESSAGES];
    };

    / * removed funtioncs */

    void handle_delete(CONNECTION_ID connection, struct user users[], int num_users) {
    char leuser[MSG_LEN];
    int i,j, nowmesg;
    char Get[MSG_LEN];

    printf("in handle delete\n");
    read_string(connection, leuser, MSG_LEN - 1);
    i = Locate (users, num_users, Get);

    /*Number of messages of Ith user*/
    nowmesg = users.num_msgs;
    read_string(connection, Get, MSG_LEN - 1);
    strcpy(users.messages[nowmesg].from, Get);

    for (j = 0; j <= nowmesg; j++) {
    line 184 users.messages[j].message = '\0';
    line 185 users.messages[j].from = '\0';
    line 186 users.messages[j].date = '\0';
    }
    }

    any suggestions??
     
    Last edited: Mar 15, 2009
    dannydb368, Mar 15, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dimitris Mandalidis

    Re: malloc & incompatible types in assignment

    Dimitris Mandalidis, Aug 31, 2003, in forum: C Programming
    Replies:
    4
    Views:
    1,014
    Al Bowers
    Aug 31, 2003
  2. Brian Stubblefield

    incompatible types in assignment

    Brian Stubblefield, May 25, 2004, in forum: C Programming
    Replies:
    7
    Views:
    33,665
    Michael Fyles
    May 30, 2004
  3. v4vijayakumar

    incompatible types in assignment

    v4vijayakumar, Jun 5, 2006, in forum: C Programming
    Replies:
    16
    Views:
    909
    Keith Thompson
    Jun 6, 2006
  4. Richard Bos

    error: incompatible types in assignment

    Richard Bos, Jul 25, 2006, in forum: C Programming
    Replies:
    8
    Views:
    1,500
    Mark McIntyre
    Jul 25, 2006
  5. wdh3rd@gmail.com
    Replies:
    3
    Views:
    820
    wdh3rd@gmail.com
    Apr 15, 2007
Loading...

Share This Page