Click here to Skip to main content
16,005,169 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: call C# function from C++ dll Pin
Code-o-mat15-Feb-12 21:47
Code-o-mat15-Feb-12 21:47 
Questionhow to find time consumed for sorting a given array[sorted/unsorted] Pin
connect2janu15-Feb-12 17:58
connect2janu15-Feb-12 17:58 
AnswerRe: how to find time consumed for sorting a given array[sorted/unsorted] Pin
Rahul Rajat Singh15-Feb-12 19:50
professionalRahul Rajat Singh15-Feb-12 19:50 
AnswerRe: how to find time consumed for sorting a given array[sorted/unsorted] Pin
Rahul Rajat Singh15-Feb-12 19:55
professionalRahul Rajat Singh15-Feb-12 19:55 
GeneralRe: how to find time consumed for sorting a given array[sorted/unsorted] Pin
connect2janu15-Feb-12 23:07
connect2janu15-Feb-12 23:07 
GeneralRe: how to find time consumed for sorting a given array[sorted/unsorted] Pin
Rahul Rajat Singh15-Feb-12 23:54
professionalRahul Rajat Singh15-Feb-12 23:54 
AnswerRe: how to find time consumed for sorting a given array[sorted/unsorted] Pin
Chuck O'Toole16-Feb-12 4:25
Chuck O'Toole16-Feb-12 4:25 
Generalsegmentation fault??? Pin
connect2janu18-Feb-12 0:12
connect2janu18-Feb-12 0:12 
here is my code-but i am getting segmentation fault???? any body help me???
programme aim is:to find a time consumed[taken] for sorting a given array

C#
#include<stdio.h>
//#include<signal.h>
//#include<conio.h>
#include<time.h>
const int MAX=1000;

int partition(int a[],int low,int high)
{
    int i,j,temp,key;
    key=a[low];
    i=low;
    j=high+1;
    while(i<=j&&key<=a[i])
    {
    i++;
    }
     while(key>a[j])
    {
    j--;
    }
     if(i<j)
    {
    temp=a[i],a[i]=a[j],a[j]=temp;
    }
      else
    {
    temp=a[low],a[low]=a[j],a[j]=a[low];
    return j ;
    }
}

void quick_sort(int a[],int low,int high)
{
    int mid;
    if(low<high)
    {
    mid=partition(a,low,high);
    quick_sort(a,low,mid-1);
    quick_sort(a,mid+1,high);
    }
}

void main()
    {
    int a[MAX],n,i,start,end;
    //clock_t end,start;
        double CLK_TCK;
    printf("enter the no of elements:");
    scanf("%d",&n);
    printf("\n enter the elements to sort\n");
    for(i=0;i<=n;i++)
    scanf("%d",&a[i]);
    start=clock();
    quick_sort(a,0,n-1);
    end=clock();
    printf("n the sorted elemetns are:\n\n");
    for(i=0;i<=n;i++)
    printf("%d\t",a[i]);
    printf("\n\n time consumed the array is: %5.2f sec: ",(end-start)/(double)CLK_TCK);
    //getch();
}

AnswerRe: segmentation fault??? Pin
Chuck O'Toole18-Feb-12 4:18
Chuck O'Toole18-Feb-12 4:18 
Questionusing SHFileOperationW, how to tell when complete and close dialog box Pin
jkirkerx15-Feb-12 10:36
professionaljkirkerx15-Feb-12 10:36 
QuestionRe: using SHFileOperationW, how to tell when complete and close dialog box Pin
Code-o-mat15-Feb-12 11:48
Code-o-mat15-Feb-12 11:48 
AnswerRe: using SHFileOperationW, how to tell when complete and close dialog box Pin
jkirkerx15-Feb-12 12:25
professionaljkirkerx15-Feb-12 12:25 
GeneralRe: using SHFileOperationW, how to tell when complete and close dialog box Pin
Code-o-mat15-Feb-12 21:41
Code-o-mat15-Feb-12 21:41 
GeneralRe: using SHFileOperationW, how to tell when complete and close dialog box Pin
jkirkerx16-Feb-12 6:22
professionaljkirkerx16-Feb-12 6:22 
GeneralLooking for an open source voice removal algorithm Pin
Yuval Naveh15-Feb-12 5:37
Yuval Naveh15-Feb-12 5:37 
GeneralRe: Looking for an open source voice removal algorithm Pin
Gary Wheeler15-Feb-12 6:02
Gary Wheeler15-Feb-12 6:02 
GeneralRe: Looking for an open source voice removal algorithm Pin
Yuval Naveh15-Feb-12 6:06
Yuval Naveh15-Feb-12 6:06 
GeneralRe: Looking for an open source voice removal algorithm Pin
Gary Wheeler15-Feb-12 6:10
Gary Wheeler15-Feb-12 6:10 
GeneralRe: Looking for an open source voice removal algorithm Pin
Yuval Naveh15-Feb-12 7:41
Yuval Naveh15-Feb-12 7:41 
QuestionHow to create TCP connections between two clients in different LAN? Pin
yu-jian14-Feb-12 14:25
yu-jian14-Feb-12 14:25 
AnswerRe: How to create TCP connections between two clients in different LAN? Pin
Jochen Arndt14-Feb-12 22:25
professionalJochen Arndt14-Feb-12 22:25 
GeneralRe: How to create TCP connections between two clients in different LAN? Pin
Erudite_Eric15-Feb-12 0:36
Erudite_Eric15-Feb-12 0:36 
GeneralRe: How to create TCP connections between two clients in different LAN? Pin
Jochen Arndt15-Feb-12 0:56
professionalJochen Arndt15-Feb-12 0:56 
GeneralRe: How to create TCP connections between two clients in different LAN? Pin
Erudite_Eric15-Feb-12 0:58
Erudite_Eric15-Feb-12 0:58 
GeneralRe: How to create TCP connections between two clients in different LAN? Pin
Jochen Arndt15-Feb-12 1:05
professionalJochen Arndt15-Feb-12 1:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.