Указатели. Ошибка компиляции в функции strcat - C (СИ)

Узнай цену своей работы

Формулировка задачи:

В функции strcat(t, *A) возникает ошибка компиляции: D:\#BC2\38.c:26: warning: assignment from incompatible pointer type D:\#BC2\38.c:27: warning: passing arg 2 of `strcat' makes pointer from integer without a cast
#include <string.h>
#include <conio.h>
#include <stdlib.h>
#include <stdio.h>
main()
  {
    int k, x;
    char *A;
    char s[80];
    char t[80];
    system("cls");
    printf("INPUT WORD ");
    scanf("%s", s);
    k = strlen(s);
    for (x = 0; x < k-1; x++)
      {
         if(s[x] != ' ')
           {
             A = &s[x];
             strcat(t, *A);
             }
         else
           {
             if(s[x + 1] != ' ' && x != 0 && x != k-1 && strlen(t) != 0)
               {
                 A = &s[x];
                 strcat(t, *A);   
               }
           }      
      }
    printf("%s", t);
    getch();
  }
D:\#BC2\38.c: In function `main': D:\#BC2\38.c:19: warning: assignment from incompatible pointer type D:\#BC2\38.c:20: warning: passing arg 2 of `strcat' makes pointer from integer without a cast D:\#BC2\38.c:26: warning: assignment from incompatible pointer type D:\#BC2\38.c:27: warning: passing arg 2 of `strcat' makes pointer from integer without a cast

Решение задачи: «Указатели. Ошибка компиляции в функции strcat»

textual
Листинг программы
strcat(t, *A)

ИИ поможет Вам:


  • решить любую задачу по программированию
  • объяснить код
  • расставить комментарии в коде
  • и т.д
Попробуйте бесплатно

Оцени полезность:

8   голосов , оценка 3.875 из 5
Похожие ответы