prompting user for file name, or comparing the file name?
To access the command line, look up the argc and argv arguments that are
passed to main().
The rest depends on the language used. But since you mentioned 'C' in your
subject...
To prompt user for file name, use fgets().
To compare file name, do you want case sensitive or insensitive compare?
For case sensitive string compare, you have strcmp().
For case insensitive c-string compare, either your compiler provides a
non-standard stricmp() that you could use, or roll one yourself using
toupper() or tolower().
HTH
Shyan
> -----Original Message-----
> From: aavvee [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 01, 2004 1:54 AM
> To: [EMAIL PROTECTED]
> Subject: [c-prog] How to compare file name with C?
>
>
> Hi,
>
> In my program, I created a file. Then I get a file name from inline
> command.
> And I want to compare if this file name is the same as the file which I
> created. How to do this? Thanks a lot!
>
> Best,
>
> Avee
>
To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.
| Yahoo! Groups Sponsor | |
|
|
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/c-prog/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
