[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Hvad går der galt?



Hej med jer.

Af en eller anden grund virker følgende kildetekst ikke:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int sorterA(char [10][81]);

int main(int argc, char *argv[])
{
  char navn[10][81];
  int taeller, res;

  for (taeller=0;taeller<10;taeller++)
  {
    printf("Indtast venligst navn nr. %d: ", taeller+1);
    gets(navn[taeller]);
  }
  printf("Nu skal navnene så sorteres\n\n");
  res = sorterA(navn[10][81]);
  printf("test");
  for (taeller=0;taeller<10;taeller++)
  {
    printf("Nu er navn nr. %d blevet %s\n", taeller+1, navn[taeller]);
  }

  
  return 0;
}

int sorterA(char navn[10][81])                     
{
  int tael, tael2;
  char streng[81];

  for (tael=0;tael<9;tael++)
  {
    for (tael2=0;tael2<9;tael2++)
    {
      if (strcmp(navn[tael2],navn[tael2+1])>0)
      {
        strcpy(streng, navn[tael2]);
        strcpy(navn[tael2], navn[tael2+1]);
        strcpy(navn[tael2+1], streng);
      }
    }
  }
  return 0;
}

Den melder en warning i linien "res=sorterA(navn[10][81]);", noget med 
warning: passing arg 1 of 'sorterA' makes pointer from integer without
cast.

Samtidig bliver alt i main efter den linie ikke kørt.

Jeg arbejder forresten i Kdevelop version 2.1.5.

Nogen ideer



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:10 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *