unary * error

In the following program, I am getting the following error:
          invalid type argument of 'unary *'

Can anyone please tell me what I am doing wrong with the structure manipulation to get this error.

Thank you very much.

P.S. For those of you who have asked about the values
of a,b,c,d, & e they really don't matter one bit.  They
will be defined later.  I am also using the
linux gcc compilier.
************************************************

#include <stdio.h>
#define a 1;
#define b 2;
#define c 3;
#define d 4;
#define e 5;

typedef struct {
      double x[100];
} Lower;

typedef struct {
      double y[100];
      Lower infer;
} Upper;

main ()
{
      
      Lower a;
      Upper k[3];
      int n, i;      
      double delta = 3.0, temp;
      double p1, p2;

      printf("Enter the values for p1 and p2: ");
      scanf("%f%f", &p1, &p2);

      for (i = 1; i <= 3; i++)
      {
            for (n = 1; n < 100; n++)
            {
                  if (i == 1)
                  {
/************ THIS IS WHERE THE PROBLEMS ARE OCCURING **********/
   k[1].y[n] = p1 *
   (a * k[1].infer.x[n-1] +
   b * k[3].y[n-1] +
   c * k[2].y[n-1] +
   d * k[1].y[n-1] +
   e) + p2;
/*************************************************************/
                  }

            }
      }

      return 0;
}


nathan_heaivilinAsked:
Who is Participating?
 
rbrCommented:
> P.S. For those of you who have asked
> about the values of a,b,c,d, & e they
> really don't matter one bit.
> They will be defined later.
> I am also using the linux gcc compilier.

Not the value the type is important. If the type isn't declared at this time you won't be able to compile the code.
                     
0
 
nathan_heaivilinAuthor Commented:
Edited text of question.
0
 
nathan_heaivilinAuthor Commented:
Edited text of question.
0
Protect Your Employees from Wi-Fi Threats

As Wi-Fi growth and popularity continues to climb, not everyone understands the risks that come with connecting to public Wi-Fi or even offering Wi-Fi to employees, visitors and guests. Download the resource kit to make sure your safe wherever business takes you!

 
graham_kCommented:
why don't you post it in the C programming area? You're much more likely to get an answer there.

Since you don't tell us what type A,B,C,D,E are, I can't help. When I cut & paste your code into Borland C++ v5.02 and declare them as 'int' it compiles o.k.
0
 
rbrCommented:
Pls tell us what A,B,C,D and E are.
0
 
nathan_heaivilinAuthor Commented:
Edited text of question.
0
 
nathan_heaivilinAuthor Commented:
Edited text of question.
0
 
rbrCommented:
Also you declare a as Lower. Lower is a structure. You can't multiply a srtructure.
0
 
ozoCommented:
remove the ; from the #define lines
your code is now
 k[1].y[n] = p1 *
                  (1;
 * k[1].infer.x[n-1] +
2;
 * k[3].y[n-1] +
0
 
nathan_heaivilinAuthor Commented:
If I cannot multiply a structure, then how do I go about multipling the values that are in that structure?
0
 
rbrCommented:
then use
 k[1].y[n] = p1 *                                         (a.x[n] * k[1].infer.x[n-1] +                                          b * k[3].y[n-1] +                                         c * k[2].y[n-1] +                                        d * k[1].y[n-1] +                                         e) + p2;

for example. I don't know what you want to do with this function.
0
 
rbrCommented:
k[1].y[n] = p1 *
(a.x[n] * k[1].infer.x[n-1] +
b * k[3].y[n-1] +
c * k[2].y[n-1] +
d * k[1].y[n-1] +
e) + p2;

ugly copy and paste. And do what ozo told you. And it is also wrong to have a define and a structure with the same name

#define a

Lower a;

0
 
ozoCommented:
It depends what the define is

#define a 1;
Lower a;

would expand to

Lower 1;;

which makes no sense, even without the ;
0
 
nathan_heaivilinAuthor Commented:
My apologies for the mix up with the a's.  The #define a 1; should be #define A 1
0
 
rbrCommented:
So can you pls post your actual code where you have problems.
0
 
nathan_heaivilinAuthor Commented:
I was able to get it to compile by getting rid of the ; at the end of the define statements.  That was apparently the problem.  I am reposting the code in a different problem.  I apologize for this, but I didn't want the a different question under this title.  The question will be under the title
"-Inf and 0 values".  Thank you for all of your help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.