User Profile

Collapse

Profile Sidebar

Collapse
ekailan
ekailan
Last Activity: Sep 12 '11, 05:58 AM
Joined: Oct 1 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • ekailan
    started a topic mixing c and c++ code in one project
    in C

    mixing c and c++ code in one project

    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?!
    See more | Go to post

  • ekailan
    replied to read line of string to array of chars
    in C
    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
    ...
    See more | Go to post

    Leave a comment:


  • ekailan
    replied to read line of string to array of chars
    in C
    I cant use any other declaration for the "packet", because its input for another algorithm ...I will try to read a bout "std::copy ".


    Thanks
    See more | Go to post

    Leave a comment:


  • ekailan
    replied to read line of string to array of chars
    in C
    thank you for your reply

    I need to copy the string to the array "packet"
    See more | Go to post

    Leave a comment:


  • ekailan
    started a topic read line of string to array of chars
    in C

    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 )
    	   {
    ...
    See more | Go to post

  • 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!!!!!!!!
    See more | Go to post

    Leave a comment:


  • ekailan
    started a topic How to get more than one thread to execute at a time?
    in C

    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:
     //----------------------------------------------//
    ...
    See more | Go to post

  • ekailan
    started a topic Assign one array to another array
    in C

    Assign one array to another array

    Code:
    wchar_t a[50];
    wchar_t b[50];
    
    a=L"asdfgh";
    why I cant say

    b=a;

    How to exchange values between tow wchar_t arrays
    See more | Go to post
    Last edited by Markus; Oct 31 '10, 02:49 PM. Reason: Fixed [code] tags

  • ekailan
    started a topic How to read data from files
    in C

    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
    ...
    See more | Go to post

  • ekailan
    started a topic How to measure memory required for a c++ program
    in C

    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
    See more | Go to post

  • ekailan
    started a topic convert char to wchar
    in C

    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
    ...
    See more | Go to post
No activity results to display
Show More
Working...