• 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
Re: problems working it out.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problems working it out.


  • Subject: Re: problems working it out.
  • From: Frederick Cheung <email@hidden>
  • Date: Fri, 17 Jun 2005 18:40:02 +0100


On 17 Jun 2005, at 18:30, D. Walsh wrote:

I've got the following routine I was trying to make dynamic but because my programming knowledge is as good as most I've run into a brick wall.

Here's my routine

int config(int argc, char *argv[])

  bool match = false;

  if (argc == 4) {
    if (strncmp("TEST=-YES", buffer, strlen("TEST=-YES"))) {


Here's what I'm trying to achieve, argv[2] holds the string in question I want to test



int config(int argc, char *argv[])

  bool match = false;

  if (argc == 4) {
    if (strncmp(argv[2]"=-YES", buffer, strlen(argv[2]"=-YES"))) {


but obviously this is wrong.


Can someone with better knowledge show me what would be correct please?


You could create a string such as sprintf(patternToTest,"%s=-YES",argv [2]) and compare that with buffer.

Fred

_______________________________________________
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


References: 
 >problems working it out. (From: "D. Walsh" <email@hidden>)

  • Prev by Date: problems working it out.
  • Next by Date: cstdlib include compile errors GCC 4.0
  • Previous by thread: problems working it out.
  • Next by thread: Re: problems working it out.
  • Index(es):
    • Date
    • Thread