+ 1

Delete elements alphabet in array c++?

anyone can make a delete element by char in array my codes not working properly

12th Mar 2017, 6:06 PM
Nabel U. Abdulmalik
Nabel U. Abdulmalik - avatar
5 Réponses
+ 16
if u want to delete char from char array then u can check my code named delete char from array
13th Mar 2017, 8:30 AM
Mansi Dagla
Mansi Dagla - avatar
+ 15
show your code
12th Mar 2017, 6:43 PM
Mansi Dagla
Mansi Dagla - avatar
0
i have been converted codes int into char but not working, I hope someone can help me
13th Mar 2017, 2:46 AM
Nabel U. Abdulmalik
Nabel U. Abdulmalik - avatar
0
I wish to convert codes also to c to c++
13th Mar 2017, 2:48 AM
Nabel U. Abdulmalik
Nabel U. Abdulmalik - avatar
0
#include <stdio.h>   /*  * C program to accept an array of integers and delete the  * specified integer from the list  */   void main() {       int vectorx[10];     int i, n, pos, element, found = 0;       printf("Enter how many elements\n");     scanf("%d", &n);     printf("Enter the elements\n");       for (i = 0; i < n; i++) {           scanf("%d", &vectorx[i]);       }       printf("Input array elements are\n");       for (i = 0; i < n; i++) {           printf("%d\n", vectorx[i]);       }       printf("Enter the element to be deleted\n");       scanf("%d", &element);       for (i = 0; i < n; i++) {         if (vectorx[i] == element) {               found = 1;             pos = i;             break;           }     }       if (found == 1) {           for (i = pos; i < n - 1; i++) {               vectorx[i] = vectorx[i + 1];           }           printf("The resultant vector is \n");           for (i = 0; i < n - 1; i++) {               printf("%d\n", vectorx[i]);           }       } else {           printf("Element %d is not found in the vector\n", element);       } }
13th Mar 2017, 2:48 AM
Nabel U. Abdulmalik
Nabel U. Abdulmalik - avatar