Hello all,

I've built a program which will take users data from the command line using int main (int argc, char *argv[]). However, when i wrote the program; i can successfully extract the options specified --php --html, etc. What i'm having a hard time with is writing the program to accept a parameter such as -t:website.com the only return parameter i'm returning is: -t: is there any way to get the -t: and break off the -t: and only return website.com? Any help would be great.

Thank you.

When you find you have a parameter that starts -t:, use strcpy() :

strcpy(websitename, &argv[p][3]);

p is of course the parameter number
3 points to the character after the colon

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.