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 8950929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:33:00+00:00 2026-06-15T13:33:00+00:00

Have source for an old program that I need to compile using modern C

  • 0

Have source for an old program that I need to compile using modern C compiler. It’s going berserk over this section:

/*
* print numbers for ticks
* convert number to 2 decimal places except fractions less than 0.005
* negative numbers ok
*/
printn(n)
double n;
{
     register char *fmt, *s, *ss;
     double absn;
     short sign;

     sign = n<0. ? -1 : 1;
     absn = n<0. ? -n : n;
     if (absn < 0.0000001) absn = 0.;

     /* if less than 0.005 then dynamically change the format */
     PPA[Phh*6)'sn < 0.005 && absn != 0.0) {
             short dec = 2;
             double nn = absn;
             while (nn < 0.005) {
                     nn =* 10.;
                     dec++;
             }
             fmt = "%-0.2f";
             fmt[4] = '0' + dec;
             s = printb(fmt, sign*absn);
             } else
             s = printb("%-0.2f", sign*absn);

     /* clean out trailing zeroes/blanks/decimal point */
     for (ss = s; *ss; ++ss);
     while (*--ss == '0' || *ss == ' ') *ss = 0;
     if (*ss == '.') *ss = 0;

     return(s);
}

Now I believe

PPA[Phh*6)'sn < 0.005 && absn != 0.0) {

perhaps due to some text conversion error should be:

if (n < 0.005 && absn != 0.0) {

but I’m also getting an “Indirection requires pointer operand (‘double’ invalid)” on:

    nn =* 10.;

Any help would be greatly appreciated.

  • 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-06-15T13:33:02+00:00Added an answer on June 15, 2026 at 1:33 pm

    nn *= 10. will multiply nn by 10

    nn = *10. will try to dereference 10., which is invalid (being a double), like the error says.

    Regarding indirection , the first search engine hit says:

    The unary indirection operator (*) dereferences a pointer; that is, it converts a pointer value to an l-value. The operand of the indirection operator must be a pointer to a type. The result of the indirection expression is the type from which the pointer type is derived

    In your case, the operand in 10., a double.

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

Sidebar

Related Questions

I have a very old project that includes the source from another project directly,
I have a set of Java 5 source files with old-style Doclet tags, comments
I have source XMLfiles that come in with multiple root elements and there is
Have a source xml document that uses namespace containing prefixes and a default namespace.
I have three source files in a folder. I simply want to compile them
I have a source XML file that is used to create C# files that
I have a source directory that includes a mix of different languages and files.
I have a source of python program which doesn't have any documentation or comments.
We have a fairly simple program that's used for creating backups. I'm attempting to
I am attempting to compile and run a C program in Xcode. This program

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.