Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7022537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:35:43+00:00 2026-05-27T23:35:43+00:00

I’m having some trouble getting my program to compile and I think the majority

  • 0

I’m having some trouble getting my program to compile and I think the majority of the problem now is that I’ve been looking at it for too long…

Overview of this one part of the program: you have a complex number in rectangular form (represented by the structure “Complex”) that you want to convert to a complex number in polar form (represented by the structure “pComplex”)

Upon trying to build, I’m getting these errors, each three times:

"error C2059: syntax error: ')'"  
"error C2059: syntax error: ';'"  
"error C2061: syntax error: identifier 'c1'"  
"error C2146: syntax error: missing ')' before identifier 'c1'"  

Also, I receive IntelliSense: identifier "Complex" is undefined but only until click on the line in question, then it goes away.

All errors point to the same line of the same header file (pcomplex.h):

pComplex NF_convert_c2_pcdouble(Complex c1);

relevant parts of pcomplex.h:

#ifndef PCOMPLEX_H
#define PCOMPLEX_H
#include "complex.h"
#include <math.h>
//
// ... 
//
typedef struct nf_complex_polar{
    double r;
    double angle;
} pComplex;
//
// ... 
//
pComplex NF_convert_c2_pcdouble(Complex c1);
//
// ... 
//
#endif

relevant parts of complex.h:

#ifndef COMPLEX_H
#define COMPLEX_H
#include "pcomplex.h"
#include <math.h>
//
// ... 
//
typedef struct nf_complex{
    double real;
    double imag;
} Complex;
//
// ... 
//
Complex NF_convert_pc2_cdouble(pComplex pc1);
//
// ... 
//
#endif

Something else I’ve noticed, when I hover over the function name in pcomplex.c,

pComplex NF_convert_c2_pcdouble(Complex c1)
{
    //This function converts a rectangular form complex number c1
    //    and returns it as a polar form complex number pc1
    pComplex pc1;
    double x, y, r, a;
    x = c1.real;
    y = c1.imag;
    r = sqrt( x*x + y*y );
    a = atan2(y,x);
    pc1.r = r;
    pc1.angle = a;
    return pc1;
}

I get a little popup box containing this, and I don’t know what the second line means:

pComplex NF_convert_c2_pcdouble(Complex c1)

pComplex NF_convert_c2_pcdouble(<error-type> c1)

Is this enough information and code to merit asking for help in figuring this out? The two header files are about 100 lines each, and the corresponding source files are about 1000 lines…so I tried to keep it relevant.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:35:44+00:00Added an answer on May 27, 2026 at 11:35 pm

    Are you coding in C or in C++ ? If coding in C++, defining your class-es should be better style.

    Having both pcomplex.h and complex.h include each other is a poor design. The inclusion graph should be a DAG.

    I suggest merging the two headers into one single header having both CartesianComplex and PolarComplex types.

    (I guess your teacher don’t want you to use the standard headers defining complex numbers)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.