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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:00:48+00:00 2026-06-07T05:00:48+00:00

I have been stuck on this for a long time and for some reason

  • 0

I have been stuck on this for a long time and for some reason my C code is not compiling. It produces a lot of cmath errors

Since It would have taken a lot of space to put my code and error together:

#include <stdlib.h>
#include <stdio.h>
#include <Windows.h>
#include <fstream>

typedef unsigned char* pointer;

void printDbPointers(void);
void show_int(int);
void show_bytes(unsigned char*, int);
void floatingPointRep();
void fahrenheit();

int main()
{
    int a = 100;
    show_int(a);
    floatingPointRep();
    fahrenheit();
    printDbPointers();
    Sleep(100000);
    return 0;
}

void printDbPointers(){
    char hi[7] = {'t', 'i', 'g', 'e', 'r', '\0'};
    char *p, **dp;

    p = &(hi[0]);
    dp = &p;

    printf("%c %c\n", *p, **dp);
    printf("%p %p %p\n", p, *dp, hi);
    p+=1;
    printf("%c, %c\n", *p, **dp);
    printf("%p %p %p\n", p, *dp, hi);
    *dp+=2;
    printf("%c, %c\n", *p, **dp);
    printf("%p %p %p\n", p, *dp, hi);
}


void show_int(int x)
{
    show_bytes((pointer) &x, sizeof(int));
}

void show_bytes(pointer start, int len)
{
    int i;
    for(i=0;i<len;i++)
    {
        // printf("0x%p\t0x%.2x\n", start + i, start[i]);
        printf("0x%p\t\n", start + i, start[i]);
        printf("\n");
    }
}


void floatingPointRep()
{
    float f1 = 1.0;
    float f2 = 0.0;
    int i;
    for ( i=0; i<10; i++ ) {
        f2 += 1.0/10.0;
    }

    printf("0x%08x 0x%08x\n", *(int*)&f1, *(int*)&f2);
    printf("f1 = %10.8f\n", f1);
    printf("f2 = %10.8f\n\n", f2);

    f1 = 1E30;
    f2 = 1E-30;
}

void fahrenheit()
{
    int i;
    double arr[3] = {12345678.000, 98765345.333, 456793332.300};
    for (i = 0; i < 3; i++)
    printf ("%g\n", arr[i]);
}

However, if it violates the rule of SO to put question code somewhere else, let me know and I will put it here

        73  error C1003: error count exceeds 100; stopping compilation  
4   error C2059: syntax error : ';' c:\program files\microsoft visual studio 11.0\vc\include\cmath  28  1   
7   error C2059: syntax error : ';' c:\program files\microsoft visual studio 11.0\vc\include\cmath  29  1   
11  error C2059: syntax error : ';' c:\program files\microsoft visual studio 11.0\vc\include\cmath  30  1   
15  error C2059: syntax error : ';' c:\program files\microsoft visual studio 11.0\vc\include\cmath  31  1   
19  error C2059: syntax error : ';' c:\program files\microsoft visual studio 11.0\vc\include\cmath  32  1   
23  error C2059: syntax error : ';' c:\program files\microsoft visual studio 11.0\vc\include\cmath  33  1   
27  error C2059: syntax error : ';' c:\program files\microsoft visual studio 11.0\vc\include\cmath  34  1   
31  error C2059: syntax error : ';' c:\program files\microsoft visual studio 11.0\vc\include\cmath  35  1   
34  error C2059: syntax error : ';' c:\program files\microsoft visual studio 11.0\vc\include\cmath  37  1   
37  error C2059: syntax error : ';' c:\program files\microsoft visual studio 11.0\vc\include\cmath  38  1   
41  error C2059: syntax error : ';' c:\program files\microsoft visual studio 11.0\vc\include\cmath  39  1   
45  error C2059: syntax error : ';' c:\program files\microsoft visual studio 11.0\vc\include\cmath  40  1   
49  error C2059: syntax error : ';' c:\program files\microsoft visual studio 11.0\vc\include\cmath  41  1   
53  error C2059: syntax error : ';' c:\program files\microsoft visual studio 11.0\vc\include\cmath  42  1   
57  error C2059: syntax error : ';' c:\program files\microsoft visual studio 11.0\vc\include\cmath  43  1   
61  error C2059: syntax error : ';' c:\program files\microsoft visual studio 11.0\vc\include\cmath  44  1   
64  error C2059: syntax error : ';' c:\program files\microsoft visual studio 11.0\vc\include\cmath  46  1   
66  error C2059: syntax error : ';' c:\program files\microsoft visual studio 11.0\vc\include\cmath  48  1   
69  error C2059: syntax error : ';' c:\program files\microsoft visual studio 11.0\vc\include\cmath  49  1   
63  error C2061: syntax error : identifier 'abs'    c:\program files\microsoft visual studio 11.0\vc\include\cmath  46  1   
65  error C2061: syntax error : identifier 'acos'   c:\program files\microsoft visual studio 11.0\vc\include\cmath  48  1   
3   error C2061: syntax error : identifier 'acosf'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  28  1   
33  error C2061: syntax error : identifier 'acosl'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  37  1   
67  error C2061: syntax error : identifier 'asin'   c:\program files\microsoft visual studio 11.0\vc\include\cmath  48  1   
5   error C2061: syntax error : identifier 'asinf'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  28  1   
35  error C2061: syntax error : identifier 'asinl'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  37  1   
68  error C2061: syntax error : identifier 'atan'   c:\program files\microsoft visual studio 11.0\vc\include\cmath  49  1   
70  error C2061: syntax error : identifier 'atan2'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  49  1   
8   error C2061: syntax error : identifier 'atan2f' c:\program files\microsoft visual studio 11.0\vc\include\cmath  29  1   
38  error C2061: syntax error : identifier 'atan2l' c:\program files\microsoft visual studio 11.0\vc\include\cmath  38  1   
6   error C2061: syntax error : identifier 'atanf'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  29  1   
36  error C2061: syntax error : identifier 'atanl'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  38  1   
71  error C2061: syntax error : identifier 'ceil'   c:\program files\microsoft visual studio 11.0\vc\include\cmath  49  1   
9   error C2061: syntax error : identifier 'ceilf'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  29  1   
39  error C2061: syntax error : identifier 'ceill'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  38  1   
72  error C2061: syntax error : identifier 'cos'    c:\program files\microsoft visual studio 11.0\vc\include\cmath  50  1   
10  error C2061: syntax error : identifier 'cosf'   c:\program files\microsoft visual studio 11.0\vc\include\cmath  30  1   
12  error C2061: syntax error : identifier 'coshf'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  30  1   
42  error C2061: syntax error : identifier 'coshl'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  39  1   
40  error C2061: syntax error : identifier 'cosl'   c:\program files\microsoft visual studio 11.0\vc\include\cmath  39  1   
13  error C2061: syntax error : identifier 'expf'   c:\program files\microsoft visual studio 11.0\vc\include\cmath  30  1   
43  error C2061: syntax error : identifier 'expl'   c:\program files\microsoft visual studio 11.0\vc\include\cmath  39  1   
14  error C2061: syntax error : identifier 'fabsf'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  31  1   
44  error C2061: syntax error : identifier 'fabsl'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  40  1   
16  error C2061: syntax error : identifier 'floorf' c:\program files\microsoft visual studio 11.0\vc\include\cmath  31  1   
46  error C2061: syntax error : identifier 'floorl' c:\program files\microsoft visual studio 11.0\vc\include\cmath  40  1   
17  error C2061: syntax error : identifier 'fmodf'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  31  1   
47  error C2061: syntax error : identifier 'fmodl'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  40  1   
18  error C2061: syntax error : identifier 'frexpf' c:\program files\microsoft visual studio 11.0\vc\include\cmath  32  1   
48  error C2061: syntax error : identifier 'frexpl' c:\program files\microsoft visual studio 11.0\vc\include\cmath  41  1   
20  error C2061: syntax error : identifier 'ldexpf' c:\program files\microsoft visual studio 11.0\vc\include\cmath  32  1   
50  error C2061: syntax error : identifier 'ldexpl' c:\program files\microsoft visual studio 11.0\vc\include\cmath  41  1   
22  error C2061: syntax error : identifier 'log10f' c:\program files\microsoft visual studio 11.0\vc\include\cmath  33  1   
52  error C2061: syntax error : identifier 'log10l' c:\program files\microsoft visual studio 11.0\vc\include\cmath  42  1   
21  error C2061: syntax error : identifier 'logf'   c:\program files\microsoft visual studio 11.0\vc\include\cmath  32  1   
51  error C2061: syntax error : identifier 'logl'   c:\program files\microsoft visual studio 11.0\vc\include\cmath  41  1   
24  error C2061: syntax error : identifier 'modff'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  33  1   
54  error C2061: syntax error : identifier 'modfl'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  42  1   
25  error C2061: syntax error : identifier 'powf'   c:\program files\microsoft visual studio 11.0\vc\include\cmath  33  1   
55  error C2061: syntax error : identifier 'powl'   c:\program files\microsoft visual studio 11.0\vc\include\cmath  42  1   
26  error C2061: syntax error : identifier 'sinf'   c:\program files\microsoft visual studio 11.0\vc\include\cmath  34  1   
28  error C2061: syntax error : identifier 'sinhf'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  34  1   
58  error C2061: syntax error : identifier 'sinhl'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  43  1   
56  error C2061: syntax error : identifier 'sinl'   c:\program files\microsoft visual studio 11.0\vc\include\cmath  43  1   
29  error C2061: syntax error : identifier 'sqrtf'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  34  1   
59  error C2061: syntax error : identifier 'sqrtl'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  43  1   
30  error C2061: syntax error : identifier 'tanf'   c:\program files\microsoft visual studio 11.0\vc\include\cmath  35  1   
32  error C2061: syntax error : identifier 'tanhf'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  35  1   
62  error C2061: syntax error : identifier 'tanhl'  c:\program files\microsoft visual studio 11.0\vc\include\cmath  44  1   
60  error C2061: syntax error : identifier 'tanl'   c:\program files\microsoft visual studio 11.0\vc\include\cmath  44  1   
  • 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-07T05:00:49+00:00Added an answer on June 7, 2026 at 5:00 am

    There seems to be some confusion. You have #included fstream, and that’s part of C++, not C.

    It seems that fstream for some reason does its own #include of cmath, and the errors probably come from incompatibilities between C and C++.

    EDIT:

    Yes, after several levels of #includes, cmath is #included, and cmath is not just a copy of math.h, but contains C++-specific code.

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

Sidebar

Related Questions

I have been stuck for a long time on this simple but obtuse message
I have now been stuck at this for some time so I though to
I have been stuck at this point for a long time and even after
Been stuck with this for a long time already. I have a URL like
i know this is basic but somehow i have been stuck here for some
I'm new to android and have been stuck on this problem for a long
I have been stuck on this for days, and was wondering if anyone had
I have been stuck on this for a while. i have tried and I
I have been stuck on this and don't really know how to go about
I have been stuck on this silly if statement, whatever i do, I cannot

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.