Switch to English?
Yes
Переключитись на українську?
Так
Переключиться на русскую?
Да
Przełączyć się na polską?
Tak
Post your project for free and start receiving proposals from freelancers within minutes after publication!

Processing code from C to C++

Translated6 USD

Client's review of cooperation with Viktor L.

Quality
Professionalism
Cost
Contactability
Deadlines

He performed the work quickly and qualityly. Thank you very much!

Profile deleted | Safe Safe

Freelancer's review of cooperation with client

Payment
Task setting
Clarity of requirements
Contactability

Clear task, fast payment and excellent communication, I recommend collaboration!

  1. 1275    23  1
    Winning proposal1 day6 USD

    Hello the Government.
    I will write the code and make even a bit of optimization if you want.
    turn to

  2. 1 proposal concealed
  • Profile deleted
    26 May 2020, 20:53 |

    Здравствуйте, хотелось бы посмотреть код

  • Profile deleted
    26 May 2020, 21:19 |

    Прикрепил в ответ на другой комментарий 

  • Andrii Fedorko
    26 May 2020, 21:02 |

    Любой С-шный код уже компилириуется на С++. Плюсы принесли з собой новые функции, и аналоги для уже существущих. Если вы уверены что перевод вам действительно нужно, то скиньте пожалуйста код.
    Писал на чистом С, люблю математику. С задачей справлюсь.

  • Profile deleted
    26 May 2020, 21:18 |

    Вот программа на C:


    //Cubic spline interpolation program
    //when we have two columns of data x and y in input file:
    //
    //x0 y0
    //x1 y1
    //...
    //xn yn
    //
    //and we want to find such function f(x)  
    //where f(xi) = yi
    //and f(x) is cubic function on every [x_k-1, x_k] segment
    //and f(x), f'(x), f''(x) are continual
    //the result is four columns of cubic polinom coefficients
    
    #include <math.h>
    #include <stdio.h>
    #include <process.h>
    float *x, *y, *h, *l, *delta, *lambda, *c, *d, *b;
    int N;
    char filename[256];
    FILE* InFile=NULL;
    void count_num_lines(){
       //count number of lines in input file - number of equations
       int nelf=0;       //non empty line flag
       do{
           nelf = 0;
           while(fgetc(InFile)!='\n' && !feof(InFile)) nelf=1;
           if(nelf) N++;
       }while(!feof(InFile));
       N--;
    }
    void readmatrix(){
       int i=0;
       //read matrixes a and b from input file
       for(i=0; i<N+1; i++){
           fscanf(InFile, "%f", &x[i]);
           fscanf(InFile, "%f", &y[i]);
       }
    }
    
    void allocmatrix(){
       //allocate memory for matrixes
       x = new float[N+1];
       y = new float[N+1];
       h = new float[N+1];
       l = new float[N+1];
       delta = new float[N+1];
       lambda = new float[N+1];
       c = new float[N+1];
       d = new float[N+1];
       b = new float[N+1];
    }
    void freematrix(){
       delete [] x;
       delete [] y;
       delete [] h;
       delete [] l;
       delete [] delta;
       delete [] lambda;
       delete [] c;
       delete [] d;
       delete [] b;
    }
    
    void printresult(){
       int k=0;
       printf("\nA[k]\tB[k]\tC[k]\tD[k]\n");
       for(k=1; k<=N; k++){
           printf("%f\t%f\t%f\t%f\n", y[k], b[k], c[k], d[k]);
       }
    }
    void testresult(){
       float start = x[0];
       float end = x[N];
       float step = (end - start)/20;
       FILE* OutFile = fopen("test.txt", "wt");
       for(float s = start; s<=end; s+= step){
           //find k, where s in [x_k-1; x_k]
           for(int k=1; k<=N; k++){
           if(s>=x[k-1] && s<=x[k]){
               break;
           }
           }
           float F = y[k] + b[k]*(s-x[k]) + c[k]*pow(s-x[k], 2) + d[k]*pow(s-x[k], 3);
           fprintf(OutFile, "%f\t%f\n", s,  F);
       }
       fclose(OutFile);
    }
    void cls(){
       for(int i=0; i<25; i++) printf("\n");
    }
    void main(){
       int k=0;
       cls();
       do{
           printf("\nInput filename: ");
           scanf("%s", filename);
           InFile = fopen(filename, "rt");
       }while(InFile==NULL);
       count_num_lines();
       rewind(InFile);
       allocmatrix();
       readmatrix();
       for(k=1; k<=N; k++){
           h[k] = x[k] - x[k-1];
           if(h[k]==0){
           printf("\nError, x[%d]=x[%d]\n", k, k-1);
           return;
           }
           l[k] = (y[k] - y[k-1])/h[k];
       }
       delta[1] = - h[2]/(2*(h[1]+h[2]));
       lambda[1] = 1.5*(l[2] - l[1])/(h[1]+h[2]);
       for(k=3; k<=N; k++){
          delta[k-1] = - h[k]/(2*h[k-1] + 2*h[k] + h[k-1]*delta[k-2]);
          lambda[k-1] = (3*l[k] - 3*l[k-1] - h[k-1]*lambda[k-2]) /
                (2*h[k-1] + 2*h[k] + h[k-1]*delta[k-2]);
       }
       c[0] = 0;
       c[N] = 0;
       for(k=N; k>=2; k--){
          c[k-1] = delta[k-1]*c[k] + lambda[k-1];
       }
       for(k=1; k<=N; k++){
          d[k] = (c[k] - c[k-1])/(3*h[k]);
          b[k] = l[k] + (2*c[k]*h[k] + h[k]*c[k-1])/3;
       }
       printresult();
       testresult();
       freematrix();
    }
  • Mark Slavenko
    26 May 2020, 21:36 |

    Вам тут из того что можно поменять.
    Разве что изменить printf на cout, да и все

Current freelance projects in the category C & C++

Comparative analysis of the effectiveness of custom software (v2.2-field) and reference software (Meshtastic v2.x)

22 USD

Comparative analysis of the effectiveness of custom software (v2.2-field) and reference software (Meshtastic v2.x) on the identical hardware platform (ESP32 + SX1268, 2W) based on the criteria of range, throughput, link stability, and power consumption. Conduct tests with…

C & C++C# ∙ 1 day 4 hours back ∙ 2 proposals

Consultation and audit of the current project on Odoo 19 Community Edition

We are looking for an Odoo Developer — a solo developer with experience in Odoo 19 Community Edition, including using Claude Code. We need a specialist who has successfully implemented projects in Odoo and practical experience in development using Claude Code. Important: we only…

C & C++Javascript and Typescript ∙ 4 days 5 hours back ∙ 7 proposals

Software development for Arduino (RF modules 3–7.5 GHz, automatic frequency scanning)

It is necessary to develop a system on Arduino for the automatic search of active analog video signals and the automatic tuning of the transmitter to the detected frequency.It is planned to use three separate transceiver modules: 3000–4200 MHz; 4900–6000 MHz; 6100–7500…

C & C++Embedded Systems & Microcontrollers ∙ 5 days 6 hours back ∙ 4 proposals

Black Ukraine (RP-project on base MTA)

1154 USD

Fixing bugs of varying complexity, like those pictured. Map navigation adjustments. Fixing map holes, adapting vehicles to the project, removing logos, or rewriting them.

C & C++Python ∙ 6 days 17 hours back ∙ 22 proposals

Residential Proxy Infrastructure Engineer

We're building a residential proxy network from scratch — fully owned, no third-party suppliers. We need one exceptional network engineer to build the entire technical foundation. What you'll build: - Android background SDK that routes proxy traffic through user devices…

C & C++DevOps ∙ 11 days 2 hours back ∙ 15 proposals

Client
Profile deleted


Project published
6 years back
102 views
Tags
  • C/C /C#