Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-27-2011, 05:57 PM   PM User | #1
fkrafi
New to the CF scene

 
Join Date: Oct 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
fkrafi is an unknown quantity at this point
Compile C++ Code using php

How can i compile c++ code in php with an external file as input and generate an output file.... i can compile it using exec("cl A.cpp") where A.cpp is the code file but i want to create A.out an output file with the help of A.cpp and A.in....

A.cpp
PHP Code:
#include<stdio.h>

int main(){
    
int n;
    while( 
scanf("%d", &n) ){
        if( !
)break;
        
printf("%d\n"n);
    } 
A.in
PHP Code:
1
2
3
4

fkrafi is offline   Reply With Quote
Reply

Bookmarks

Tags
c++, compile, php

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:47 AM.


Advertisement
Log in to turn off these ads.