نمایش نتایج 1 تا 2 از 2

نام تاپیک: ایجاد خطا در کامپایلر TC

  1. #1

    Unhappy ایجاد خطا در کامپایلر TC

    سلام

    من نمیدونم چرا هر برنامه ای رو میخوام اجرا کنم با TC همش از این خط اررور میگیره

    /* Copyright (c) 2009 the authors listed at the following URL, and/or
    the authors of referenced articles or incorporated external code:
    http://en.literateprograms.org/Merge...20060514200945
    Permission is hereby granted, free of charge, to any person obtaining
    a copy of this software and associated documentation files (the
    "Software"), to deal in the Software without restriction, including
    without limitation the rights to use, copy, modify, merge, publish,
    distribute, sublicense, and/or sell copies of the Software, and to
    permit persons to whom the Software is furnished to do so, subject to
    the following conditions:
    The above copyright notice and this permission notice shall be
    included in all copies or substantial portions of the Software.
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    Retrieved from: http://en.literateprograms.org/Merge...(C)?oldid=4743
    */
    #include <string.h>
    #include <time.h> /* time() */
    #include <stdlib.h> /* rand() */
    #include <stdio.h> /* puts() */
    #define MIN_MERGESORT_LIST_SIZE 32

    void mergesort_array(int a[], int size, int temp[]) {
    int i1, i2, tempi;
    if (size < MIN_MERGESORT_LIST_SIZE) {
    /* Use insertion sort */
    int i;
    for (i=0; i < size; i++) {
    int j, v = a[i];
    for (j = i - 1; j >= 0; j--) {
    if (a[j] <= v) break;
    a[j + 1] = a[j];
    }
    a[j + 1] = v;
    }
    return;
    }
    mergesort_array(a, size/2, temp);
    mergesort_array(a + size/2, size - size/2, temp);
    i1 = 0;
    i2 = size/2;
    tempi = 0;
    while (i1 < size/2 && i2 < size) {
    if (a[i1] < a[i2]) {
    temp[tempi] = a[i1];
    i1++;
    } else {
    temp[tempi] = a[i2];
    i2++;
    }
    tempi++;
    }
    while (i1 < size/2) {
    temp[tempi] = a[i1];
    i1++;
    tempi++;
    }
    while (i2 < size) {
    temp[tempi] = a[i2];
    i2++;
    tempi++;
    }
    memcpy(a, temp, size*sizeof(int));
    }

    int main(int argc, char* argv[]) {
    int size = atoi(argv[1]);
    int* a = malloc(sizeof(int)*size);
    int* temp = malloc(sizeof(int)*size);
    int i;
    srand(time(NULL));
    for(i=0; i<size; i++) {
    a[i] = rand() % size;
    }
    mergesort_array(a, size, temp);
    for(i=1; i<size; i++) {
    if (!(a[i-1] <= a[i])) {
    puts("ERROR");
    return -1;
    }
    }
    puts("SUCCESS");
    return 0;
    }



    از خط include که همش میگه Decelration syntax error

    یکی راهنماییم کنه لطفآ

  2. #2

    نقل قول: Help me

    شلید توی محیط win 32 project مینویسی!!1

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •