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
    Likes Received:
    0
    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. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.