未定义对scanf的引用

时间:2018-07-12 12:32:01

标签: scanf undefined

我正在尝试使用功能“ scanf”,但出现此错误。 这是我使用函数scanf()的地方。我搜索了一些可以在互联网上为我提供帮助的信息,但我只发现了一个忘记了“ #include stdio.h”的人。

else if(strlen(word[1]) == 4  && strcmp(word[2], "message") == 0 )
    {
        char msg[100];
        uint16_t addr;
        printf("Entrer un message : \n");
        scanf("%s", msg);
        snprintf((char*)radio.packet, 100, "Message de %x : %s \n", radio.addr, msg);
        radio.length = 1 + strlen((char*)radio.packet);
        radio.addr = addr;
        printf("sending %s to %x \n", word[2], strtoul(word[1], NULL, 16));
        send_packet(strtoul(word[1], NULL, 16), ("%s \n", (char*)radio.packet));
        mac_send((char*)radio.packet, radio.length, radio.addr);
        printf("radio : %s \n", (char*)radio.packet);
        printf(" message : %i \n", msg);
    }

这是我的宝贝

#include <msp430.h>//#include <io.h>
#include <legacymsp430.h>//#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>

0 个答案:

没有答案