• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
problem with c code.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problem with c code.


  • Subject: problem with c code.
  • From: "D.Walsh" <email@hidden>
  • Date: Mon, 28 Feb 2005 12:29:37 -0500
  • Mta-interface: amavisd-new-2.2.1 (2004-12-22) at daleenterprise.com

I'm looking for a quick solution, I'm passing partial filenames back and forth from argv[1] to other variables.

While making the project in XCode appears to work properly, compiling with gcc in terminal so it will build on any platforms is causing problems because finding all of the equivalent C functions is driving me nuts.

Basically what I need is this.

argv[1] holds the filename.

It's transfered to my routine with: (partial code listed)

#include <stdio.h>

void   create_logo_file    ( char * infilename);

main(int argc, char * argv[]) {
   char *prog_name=argv[0];

	if (argc !=2)  {
		printf("\n\t%s syntax:\n\n", argv[0]);
		printf("\t\t%s filename\n\n", argv[0]);
		exit(0);
	 }

	create_logo_file( argv[1] );
}
void create_logo_file( char * infilename) {
	char *logo_name;
	char *logo_file_name";
}
__________________________________________________


I need to remove all of the path info from argv[1] and store it in "logo_name" with ".gif" removed as well.


I need to transfer what is in "logo_name" with "_logo.h" appended and store it in "logo_file_name".

Needless to say, NSScanner is not an option since it wont compile on other OS's.

Anyone have any code that does this?

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: problem with c code.
      • From: Robert Tillyard <email@hidden>
  • Prev by Date: Re: "distccsched" eating cpu, running hot
  • Next by Date: Re: "distccsched" eating cpu, running hot
  • Previous by thread: Reordering of Instructions in a Threaded Context
  • Next by thread: Re: problem with c code.
  • Index(es):
    • Date
    • Thread