Language: C

/*  ex4_4
    potter0723sw  */

#include <stdio.h>

void werase(int *ptr, int *last);//ptrは削除位置、lastは末尾位置
void erase(int *ptr, int *last);

int main(void){
    int height, width, i, j;
    char cell[101][101];
    scanf("%d %d", &height, &width);

    for(i=0; i < height; i++){//マスの入力を受け取る
        for(j=0; j < width; j++){
            scanf("　%c", &cell[i][j]);
        }
    }

    for(i=0; i < height; i++){
        for(j=0; j < width; j++){
            if(cell[i][j] == '#'){//黒マス発見でループ脱出
                break;
            }
            if(j = width - 1){//最後のマスまで白なら行削除
                werase(begin(cell)+ i * width,width * height);
                height = height - 1;
            }
        }
    }

    for(j=0; j < width; j++){
        for(i=0; i < height; i++){
            if(cell[i][j] == '#'){//黒マス発見でループ脱出
                break;
            }
            if(j = height - 1){//最後のマスまで白なら行削除
                for(i=0; i < height; i++){
                    erase(begin(cell)+ i * width + j,width * height);
                }
                width = width - 1;
            }
        }
    }

    for(i=0; i < height; i++){
        for(j=0; j < height; j++){
            printf("%c", cell[i][j]);
        }
        printf("\n");
    }
}

void werase(int *wptr, int *wlast){
    while(++wptr < wlast){
        *(wptr - width) = *wptr;//要素をひとつ前にずらす
    }
}

void erase(int *ptr, int *last){
    while(++ptr < last){
        *(ptr - 1) = last;
    }
}


Compiler output:
main.c: In function 'main':
main.c:26:24: error: implicit declaration of function 'begin' [-Wimplicit-function-declaration]
   26 |                 werase(begin(cell)+ i * width,width * height);
      |                        ^~~~~
main.c:26:35: error: passing argument 1 of 'werase' makes pointer from integer without a cast [-Wint-conversion]
   26 |                 werase(begin(cell)+ i * width,width * height);
      |                        ~~~~~~~~~~~^~~~~~~~~~~
      |                                   |
      |                                   int
main.c:6:18: note: expected 'int *' but argument is of type 'int'
    6 | void werase(int *ptr, int *last);//ptrは削除位置、lastは末尾位置
      |             ~~~~~^~~
main.c:26:53: error: passing argument 2 of 'werase' makes pointer from integer without a cast [-Wint-conversion]
   26 |                 werase(begin(cell)+ i * width,width * height);
      |                                               ~~~~~~^~~~~~~~
      |                                                     |
      |                                                     int
main.c:6:28: note: expected 'int *' but argument is of type 'int'
    6 | void werase(int *ptr, int *last);//ptrは削除位置、lastは末尾位置
      |                       ~~~~~^~~~
main.c:39:50: error: passing argument 1 of 'erase' makes pointer from integer without a cast [-Wint-conversion]
   39 |                     erase(begin(cell)+ i * width + j,width * height);
      |                           ~~~~~~~~~~~~~~~~~~~~~~~^~~
      |                                                  |
      |                                                  int
main.c:7:17: note: expected 'int *' but argument is of type 'int'
    7 | void erase(int *ptr, int *last);
      |            ~~~~~^~~
main.c:39:60: error: passing argument 2 of 'erase' makes pointer from integer without a cast [-Wint-conversion]
   39 |                     erase(begin(cell)+ i * width + j,width * height);
      |                                                      ~~~~~~^~~~~~~~
      |                                                            |
      |                                                            int
main.c:7:27: note: expected 'int *' but argument is of type 'int'
    7 | void erase(int *ptr, int *last);
      |                      ~~~~~^~~~
main.c: In function 'werase':
main.c:56:18: error: 'width' undeclared (first use in this function)
   56 |         *(wptr - width) = *wptr;//要素をひとつ前にずらす
      |                  ^~~~~
main.c:56:18: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'erase':
main.c:62:20: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
   62 |         *(ptr - 1) = last;
      |                    ^