Click here to Skip to main content
15,867,765 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i want to use system function and its property in vc++ for this code can anyone guide me for this as i am new in vc++

C++
#include "stdafx.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
   char command[50];
   int port;
   printf("enter port ");
   scanf("%d", &port);

   sprintf_s(command, sizeof command, "netstat -ano | findstr %d", port );
   system(command);


   system("pause");

   return(0);
}



if possible than please provide me code for vc++ for this
Posted
Updated 8-Jun-14 22:17pm
v2
Comments
Richard MacCutchan 9-Jun-14 4:21am    
There is no such language as vc++, only C++. Also, all standard C-library functions may also be used in C++ programs.

Simply there is no need to convert, your code should work as it stands.
 
Share this answer
 
You don't have to convert anything. C++ is backward compatible with C. Just use it as it is.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900