hello everyone, i used the method substr() in a c++ program . I now need to convert my program in C. Does anyone know if there exists an equivalent of the method substr() in C???

no -- you have to write your own. Makes for good practice sharpening your programming skills.:cheesy:

Make your own by using strstr().

int validate (char *check[], int AMMOUNTINARRAY)
{
    int through = 0;
    bool error = false;
    do {
        if(!*check[through]=={'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'})
        error = true;
        through++;
    } while(through<=AMMOUNTINARRAY);
}

I know its just shorthand but the theory is the same

know its just shorthand but the theory is the same

And what theory would that be? How does your code snippet help the OP write a substr() function ?

And why respond to a year-old thread?

> And why respond to a year-old thread?
Because they can :rolleyes:

> if(!*check[through]=={'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'})
Gotta wonder what the hell that's supposed to achieve.

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.