Compiling a c source file through c++ code
I have a c++ program in visual studio 2015 , where I get as a input a c++ file,whichI do some changes to it. Afterwards, I want through a c++ code to make visual studio compile this file again.
Is there any way to do this (not through a command line)?
See also questions close to this topic

how to find all permutations of an n digit number without using array or function in c++
I am having problems with making this code work the way I want it to. The task is to write a program that prints all the numbers obtained by permutation of digits 1 to n for the entered number n (1 <= n <= 9). The program should also print out how many such numbers are there. I made a for loop that gets the factorial of n so I can get the number of permutation and I combine all of the numbers from 1 to n into a single integer because I think there should be a way to find the permutations that way. So my question is how can I find these permutations?
#include <iostream> using namespace std; int main(){ int n; int j; int r=0; int t=1; double f=1; cin>>n; for(int p=1;p<=n1;p++){ t=t*10; } int u=t; //calculates the factorial of n for(int o=1;o<=n;o++){ f=f*o; } //writes numbers from 1 to n into an integer for(int d=1;d<=n;d++){ j=d*u; r=r+j; u=u/10; } }

How to ask macports to wrap openmpi with intel compilers?
I used macports to install openmpi. However, I realized when I use mpicxx, it actually uses clang at backend. I want it to wrap with intel compiler (i.e. icpc). I checked the openmpi website, but didn't figure out how to do this. Could anyone help me?

A C++ program of adding numbers without adding the carry
Trans bought a calculator at creatnx's store. Unfortunately, it is fake. It has many bugs. One of them is adding two numbers without carrying. Example expression: 12 + 9 will have result 11 in his calculator. Given an expression in the form a + b, please output result from that calculator. Constraints: 1 ≤ T ≤ 100 1 ≤ a, b ≤ 109
My code pass the test cases where 1 ≤ a, b ≤ 9 But failed for the original contraints. Could not find the case where my code giving wrong answer.
My Code
#include <iostream> #include<string> #define ll long long int using namespace std; int main() { ll t; cin>>t; while(t){ string a, b; cin>>a>>b; ll max_last = max(a.size(), b.size()); ll min_last = min(a.size(), b.size()); ll result[max_last]; ll i=max_last1; for(ll j= min_last1; j>=0; i, j){ ll sum = a[i]'0' + b[j]'0'; result[i] = sum ; } while(i>=0){ result[i] = a[i]'0'; i; } ll sum = 0; for(ll i=0; i<max_last; i++){a sum = sum*10 + result[i]%10; } cout<<sum<<"\n"; } return 0; }
Tester's Code
#include <bits/stdc++.h> using namespace std; signed main() { int t; cin >> t; assert(1 <= t && t <= 100); while(t) { int a, b; cin >> a >> b; assert(1 <= a && a <= 1'000'000'000); assert(1 <= b && b <= 1'000'000'000); vector<int> A, B; while(a) { A.push_back(a % 10); a /= 10; } while(b) { B.push_back(b % 10); b /= 10; } while(A.size() < B.size()) A.push_back(0); while(B.size() < A.size()) B.push_back(0); for(int i = 0; i < A.size(); i++) { A[i] += B[i]; } int ans = 0; reverse(begin(A), end(A)); for(auto it: A) { ans = ans * 10 + it % 10; } cout << ans << endl; } }