#include<cstdio>
#include<string>
#include "inventory.h"
#include "node.h"
#include<iostream>
using namespace std ;
int main (){
    inventory*obj1=new inventory();
     int size;
    int id,i;
     char A[100];
    char S_string;
    cout<<"plz enter the size of the list "<<endl;
    cin>>size;
    for(i=0;i<100;i++){
    cin>>S_string;
    A[i]=S_string;
    }
    int a=strcmp(A[i],"new");
    if(a==0){
    for(int j=0;j<size;j++){
        cout<<"enter the id"<<endl;
        cin>>id;
        obj1->new_id(id);
    }
    }
getchar();
getchar();
return 0; 
}

it gives me a red line under (A[i]) in [(A[i],"new")];
what should I do ?

First of all you need to include string.h, not string, to get the declaration of strcmp (or even better keep including string, use the string class and don't bother with strcmp at all).

Secondly A is an array of chars, not strings or char pointers, so A[i] is a char and thus not a valid argument to strcmp. It also can't possibly be equal to "new" for that reason.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.