I have a c++ project and i have a c code I need to mix them both in one solution .....I still get errors .
I need the c code to be in one class and I need to call it from a c++ main()/
any official technique?!
User Profile
Collapse
-
mixing c and c++ code in one project
-
I modified the code to this, but I get this error
" out of memory".after three iteration of excution.
...Code:char *packet; packet=new char [1000000]; ifstream inFile2; string t, line; cout<<"Enter a file name.\n"; cin>>t; inFile2.open(t.c_str()); if ( !inFile2 ) { cout<<"Unable to open -
I cant use any other declaration for the "packet", because its input for another algorithm ...I will try to read a bout "std::copy ".
ThanksLeave a comment:
-
thank you for your reply
I need to copy the string to the array "packet"Leave a comment:
-
read line of string to array of chars
I am reading a file line by line I need to copy the line which is string to array of chars named packet.
what function could help me do that.
this is my code:
...Code:char *packet; packet=new char [1000000]; ifstream inFile2; string t, line; cout<<"Enter a file name.\n"; cin>>t; inFile2.open(f.c_str()); if ( !inFile2 ) { -
yes, the problem is when i run this code one thread is excuted then the system teriminate the threads and exit is it possible that this problem caused by line 88
"" .Code:ExitProcess(0);
each program have to open the same files , they poth perform open file ....mybe this is the problem i dont know!!!!!!!!Leave a comment:
-
How to get more than one thread to execute at a time?
I am working on creating windows.h to creat tow threads, each thread takes tow files as input, the function that each thread excute is tested and work 100%,the problem is that one thread could work at atime ?
I mean one function is excuted this is the threading code i dont know what is the problem. I tried to pass different files to each thread but its still not working
*************** ************
...Code://----------------------------------------------//
-
Assign one array to another array
why I cant sayCode:wchar_t a[50]; wchar_t b[50]; a=L"asdfgh";
b=a;
How to exchange values between tow wchar_t arrays -
How to read data from files
I want to read the string in 4 files as the cose show, the problem is that the code read the data from the first file only ?!!this is the code ....I dont know what is the problem
...Code:ifstream inFile1; char *p; p = new char[500]; ofstream Result; Result.open("Result.txt"); for(i=1;i<5;++i) { //Inter the Patterns -
How to measure memory required for a c++ program
is three a way to mesure the amount of memory required during the execution of a C++ program , is there alibrary to help do this? under windows OS
Thanks -
convert char to wchar
This is a test code to convert chat to wchar the problem is that each time the else statement is executed .....So the conversion is not working !!!!!!!
...Code:char p[500]; while(getline(inFile1, line)) { //we read p from file that contain only one word "why"............for testing strcpy_s(p, 500, line.c_str()); string search = p; const size_t
No activity results to display
Show More
Leave a comment: