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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nathan_heaivilinAuthor Commented:
Edited text of question.
nathan_heaivilinAuthor Commented:
Edited text of question.
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.
Cloud as a Security Delivery Platform for MSSPs

Every Managed Security Service Provider (MSSP) needs a platform to deliver effective and efficient security-as-a-service to their customers. Scale, elasticity and profitability are a few of the many features that a Cloud platform offers. View our on-demand webinar to learn more!

rbrCommented:
Pls tell us what A,B,C,D and E are.
nathan_heaivilinAuthor Commented:
Edited text of question.
nathan_heaivilinAuthor Commented:
Edited text of question.
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.
                     

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rbrCommented:
Also you declare a as Lower. Lower is a structure. You can't multiply a srtructure.
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] +
nathan_heaivilinAuthor Commented:
If I cannot multiply a structure, then how do I go about multipling the values that are in that structure?
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.
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;

ozoCommented:
It depends what the define is

#define a 1;
Lower a;

would expand to

Lower 1;;

which makes no sense, even without the ;
nathan_heaivilinAuthor Commented:
My apologies for the mix up with the a's.  The #define a 1; should be #define A 1
rbrCommented:
So can you pls post your actual code where you have problems.
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Hardware

From novice to tech pro — start learning today.