Advertisement

05.10.2008 at 09:03AM PDT, ID: 23391760
[x]
Attachment Details

strlen in a array of characters

Asked by dandeliondream in C++ Programming Language

I've problem allocating dynamic memory to the fruit name in the for loop. Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
fruitType::fruitType(char *ctyname, int frtCount, char **fru)
{
   
   countryName = new char[strlen(ctyname) + 1]; 
   strcpy(countryName, tit); 
   
 
   fruitCount = frtCount;
   
  
   for (int i = 0; i < frtCount; i++)
   {
       *(FRUITS + i) = new char[strlen{fru) + 1];
       fru + i;
   }
   for (int i = 0; i < auSize; i++)
       strcpy(*(FRUITS + i), *(fru + i)); 
}
[+][-]05.10.2008 at 09:06AM PDT, ID: 21539479

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.10.2008 at 09:07AM PDT, ID: 21539484

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.10.2008 at 09:21AM PDT, ID: 21539519

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.10.2008 at 09:24AM PDT, ID: 21539535

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.10.2008 at 09:37AM PDT, ID: 21539584

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.10.2008 at 09:40AM PDT, ID: 21539594

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.10.2008 at 06:50PM PDT, ID: 21541221

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.10.2008 at 08:37PM PDT, ID: 21541389

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.11.2008 at 12:52AM PDT, ID: 21541752

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: C++ Programming Language
Sign Up Now!
Solution Provided By: Infinity08
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628