Language: C

Last login: Tue Dec 25 18:36:38 on ttys000
OpenAppLab-no-MacBook-Air:~ openapplab$ cd Desktop
OpenAppLab-no-MacBook-Air:Desktop openapplab$ cd unko
OpenAppLab-no-MacBook-Air:unko openapplab$ atom alg6-2.c
-bash: atom: command not found
OpenAppLab-no-MacBook-Air:unko openapplab$ ls
2-3.c		alg3-1.c	logo.pbm	prog01.c~
3-2.c		alg4-2.c	p1.pbm		prog02.c
a.out		alg5-2.c	p2.pbm		prog02.c~
alg1-4.c	circle		prog01.c	ryo.pbm
OpenAppLab-no-MacBook-Air:unko openapplab$ atom alg6-2.c
OpenAppLab-no-MacBook-Air:unko openapplab$ gcc alg6-2.c
alg6-2.c:4:1: warning: type specifier missing, defaults to 'int'
      [-Wimplicit-int]
partiotion(int A[],int p,int r)
^
alg6-2.c:30:5: warning: implicit declaration of function 'partition' is invalid
      in C99 [-Wimplicit-function-declaration]
  p=partition(A,0,i);
    ^
2 warnings generated.
Undefined symbols for architecture x86_64:
  "_partition", referenced from:
      _main in alg6-2-4ff43f.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
OpenAppLab-no-MacBook-Air:unko openapplab$ gcc alg6-2.c
alg6-2.c:4:1: warning: type specifier missing, defaults to 'int'
      [-Wimplicit-int]
partiotion(int A[],int p,int r)
^
alg6-2.c:30:5: warning: implicit declaration of function 'partition' is invalid
      in C99 [-Wimplicit-function-declaration]
  p=partition(A,0,i);
    ^
2 warnings generated.
Undefined symbols for architecture x86_64:
  "_partition", referenced from:
      _main in alg6-2-d37754.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
OpenAppLab-no-MacBook-Air:unko openapplab$ gcc alg6-2.c
alg6-2.c:30:5: warning: implicit declaration of function 'partition' is invalid
      in C99 [-Wimplicit-function-declaration]
  p=partition(A,0,i);
    ^
1 warning generated.
Undefined symbols for architecture x86_64:
  "_partition", referenced from:
      _main in alg6-2-f7bf56.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
OpenAppLab-no-MacBook-Air:unko openapplab$ gcc alg6-2.c
OpenAppLab-no-MacBook-Air:unko openapplab$ ./a.out
12
13 19 9 5 12 8 7 4 21 2 6 11
[0] 19 9 5 12 8 7 4 21 2 6 11OpenAppLab-no-MacBook-Air:unko openapplab$ gcc alg6-2.c
OpenAppLab-no-MacBook-Air:unko openapplab$ ./a.out
12
13 19 9 5 12 8 7 4 21 2 6 11
9 5 8 7 4 2 6 [11] 21 13 19 12
OpenAppLab-no-MacBook-Air:unko openapplab$ S
PAM Authentication
Password: 
Last login: Thu Dec 27 2018 07:43:54 +0900 from x123239
Oracle Corporation     SunOS 5.11      11.3    January 2017

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- Solaris:
  - Computer Exercise Room 1 and 2  ... std1dc2 - std1dc46, std2dc2 - std2dc46
  - Standard Environment Server     ... solsv171 - solsv174
- macOS:
  - Computer Exercise Room 5 and 6  ... std5dc2 - std5dc50, std6dc2 - std6dc50
  - iLab 1 and 2                ... ilab1dc2 - ilab1dc49, ilab2dc2 - ilab2dc49
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Terminal type is xterm-256color.                                        
Terminal type is xterm-256color.                                        
Erase is backspace.
sshsv171:~ s1260011[51]$ cd alg1
sshsv171:alg1 s1260011[52]$ ls
'#aig3-1.c#'  a.out      alg1-1.c   alg2-1.c   alg4-1.c~  alg6-1.c~
'#alg1-1#'    aig3-1     alg1-1.c~  alg2-1.c~  alg4-2.c   core
'#alg2-1.c#'  aig3-1.c   alg1-2.c   alg2-2.c   alg5-1.c
'#alg5-2.c#'  aig3-1.c~  alg1-2.c~  alg2-2.c~  alg5-1.c~
'#alg6-1.c#'  alg1-1     alg1-3.c   alg4-1.c   alg6-1.c
sshsv171:alg1 s1260011[53]$ emacs alg6-1.c

File Edit Options Buffers Tools C Help                                          
int main(){
  unsigned short A[VMAX], B[VMAX];

  scanf("%d", &n);

  //A = malloc(sizeof(short)*n+1);                                              
  //B = malloc(sizeof(short)*n+1);                                              

  for(i=0;i<n;i++) scanf("%d",&A[i]);
  CountingSort(A,B,VMAX);

  for(i=1;i<=n;i++){
    printf("%d",B[i]);
    if(i==n){
      printf("\n");
    }else printf(" ");
  }
  return 0;
}




Compiler output:
main.c:1:1: error: unknown type name 'Last'
    1 | Last login: Tue Dec 25 18:36:38 on ttys000
      | ^~~~
main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
    1 | Last login: Tue Dec 25 18:36:38 on ttys000
      |           ^
main.c:4:54: error: invalid suffix "c" on floating constant
    4 | OpenAppLab-no-MacBook-Air:unko openapplab$ atom alg6-2.c
      |                                                      ^~~
main.c:7:3: error: invalid suffix "c" on floating constant
    7 | 2-3.c           alg3-1.c        logo.pbm        prog01.c~
      |   ^~~
main.c:7:22: error: invalid suffix "c" on floating constant
    7 | 2-3.c           alg3-1.c        logo.pbm        prog01.c~
      |                      ^~~
main.c:8:3: error: invalid suffix "c" on floating constant
    8 | 3-2.c           alg4-2.c        p1.pbm          prog02.c
      |   ^~~
main.c:8:22: error: invalid suffix "c" on floating constant
    8 | 3-2.c           alg4-2.c        p1.pbm          prog02.c
      |                      ^~~
main.c:9:22: error: invalid suffix "c" on floating constant
    9 | a.out           alg5-2.c        p2.pbm          prog02.c~
      |                      ^~~
main.c:10:6: error: invalid suffix "c" on floating constant
   10 | alg1-4.c        circle          prog01.c        ryo.pbm
      |      ^~~
main.c:11:54: error: invalid suffix "c" on floating constant
   11 | OpenAppLab-no-MacBook-Air:unko openapplab$ atom alg6-2.c
      |                                                      ^~~
main.c:12:53: error: invalid suffix "c" on floating constant
   12 | OpenAppLab-no-MacBook-Air:unko openapplab$ gcc alg6-2.c
      |                                                     ^~~
main.c:13:6: error: invalid suffix "c" on floating constant
   13 | alg6-2.c:4:1: warning: type specifier missing, defaults to 'int'
      |      ^~~
main.c:13:60: warning: multi-character character constant [-Wmultichar]
   13 | alg6-2.c:4:1: warning: type specifier missing, defaults to 'int'
      |                                                            ^~~~~
main.c:17:6: error: invalid suffix "c" on floating constant
   17 | alg6-2.c:30:5: warning: implicit declaration of function 'partition' is invalid
      |      ^~~
main.c:17:58: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
   17 | alg6-2.c:30:5: warning: implicit declaration of function 'partition' is invalid
      |                                                          ^~~~~~~~~~~
main.c:20:5: error: expected identifier or '(' before '^' token
   20 |     ^
      |     ^
main.c:24:23: error: invalid suffix "ff43f.o" on integer constant
   24 |       _main in alg6-2-4ff43f.o
      |                       ^~~~~~~~
main.c:27:53: error: invalid suffix "c" on floating constant
   27 | OpenAppLab-no-MacBook-Air:unko openapplab$ gcc alg6-2.c
      |                                                     ^~~
main.c:28:6: error: invalid suffix "c" on floating constant
   28 | alg6-2.c:4:1: warning: type specifier missing, defaults to 'int'
      |      ^~~
main.c:28:60: warning: multi-character character constant [-Wmultichar]
   28 | alg6-2.c:4:1: warning: type specifier missing, defaults to 'int'
      |                                                            ^~~~~
main.c:32:6: error: invalid suffix "c" on floating constant
   32 | alg6-2.c:30:5: warning: implicit declaration of function 'partition' is invalid
      |      ^~~
main.c:32:58: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
   32 | alg6-2.c:30:5: warning: implicit declaration of function 'partition' is invalid
      |                                                          ^~~~~~~~~~~
main.c:35:5: error: expected identifier or '(' before '^' token
   35 |     ^
      |     ^
main.c:42:53: error: invalid suffix "c" on floating constant
   42 | OpenAppLab-no-MacBook-Air:unko openapplab$ gcc alg6-2.c
      |                                                     ^~~
main.c:43:6: error: invalid suffix "c" on floating constant
   43 | alg6-2.c:30:5: warning: implicit declaration of function 'partition' is invalid
      |      ^~~
main.c:43:58: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
   43 | alg6-2.c:30:5: warning: implicit declaration of function 'partition' is invalid
      |                                                          ^~~~~~~~~~~
main.c:46:5: error: expected identifier or '(' before '^' token
   46 |     ^
      |     ^
main.c:53:53: error: invalid suffix "c" on floating constant
   53 | OpenAppLab-no-MacBook-Air:unko openapplab$ gcc alg6-2.c
      |                                                     ^~~
main.c:57:28: error: invalid suffix "OpenAppLab" on integer constant
   57 | [0] 19 9 5 12 8 7 4 21 2 6 11OpenAppLab-no-MacBook-Air:unko openapplab$ gcc alg6-2.c
      |                            ^~~~~~~~~~~~
main.c:57:82: error: invalid suffix "c" on floating constant
   57 | [0] 19 9 5 12 8 7 4 21 2 6 11OpenAppLab-no-MacBook-Air:unko openapplab$ gcc alg6-2.c
      |                                                                                  ^~~
main.c:65:39: error: invalid digit "9" in octal constant
   65 | Last login: Thu Dec 27 2018 07:43:54 +0900 from x123239
      |                                       ^~~~
main.c:76:24: error: invalid suffix "color." on integer constant
   76 | Terminal type is xterm-256color.
      |                        ^~~~~~~~~
main.c:77:24: error: invalid suffix "color." on integer constant
   77 | Terminal type is xterm-256color.
      |                        ^~~~~~~~~
main.c:81:1: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
   81 | '#aig3-1.c#'  a.out      alg1-1.c   alg2-1.c   alg4-1.c~  alg6-1.c~
      | ^~~~~~~~~~~~
main.c:81:31: error: invalid suffix "c" on floating constant
   81 | '#aig3-1.c#'  a.out      alg1-1.c   alg2-1.c   alg4-1.c~  alg6-1.c~
      |                               ^~~
main.c:81:42: error: invalid suffix "c" on floating constant
   81 | '#aig3-1.c#'  a.out      alg1-1.c   alg2-1.c   alg4-1.c~  alg6-1.c~
      |                                          ^~~
main.c:81:53: error: invalid suffix "c" on floating constant
   81 | '#aig3-1.c#'  a.out      alg1-1.c   alg2-1.c   alg4-1.c~  alg6-1.c~
      |                                                     ^~~
main.c:81:64: error: invalid suffix "c" on floating constant
   81 | '#aig3-1.c#'  a.out      alg1-1.c   alg2-1.c   alg4-1.c~  alg6-1.c~
      |                                                                ^~~
main.c:82:1: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   82 | '#alg1-1#'    aig3-1     alg1-1.c~  alg2-1.c~  alg4-2.c   core
      | ^~~~~~~~~~
main.c:82:31: error: invalid suffix "c" on floating constant
   82 | '#alg1-1#'    aig3-1     alg1-1.c~  alg2-1.c~  alg4-2.c   core
      |                               ^~~
main.c:82:42: error: invalid suffix "c" on floating constant
   82 | '#alg1-1#'    aig3-1     alg1-1.c~  alg2-1.c~  alg4-2.c   core
      |                                          ^~~
main.c:82:53: error: invalid suffix "c" on floating constant
   82 | '#alg1-1#'    aig3-1     alg1-1.c~  alg2-1.c~  alg4-2.c   core
      |                                                     ^~~
main.c:83:1: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
   83 | '#alg2-1.c#'  aig3-1.c   alg1-2.c   alg2-2.c   alg5-1.c
      | ^~~~~~~~~~~~
main.c:83:20: error: invalid suffix "c" on floating constant
   83 | '#alg2-1.c#'  aig3-1.c   alg1-2.c   alg2-2.c   alg5-1.c
      |                    ^~~
main.c:83:31: error: invalid suffix "c" on floating constant
   83 | '#alg2-1.c#'  aig3-1.c   alg1-2.c   alg2-2.c   alg5-1.c
      |                               ^~~
main.c:83:42: error: invalid suffix "c" on floating constant
   83 | '#alg2-1.c#'  aig3-1.c   alg1-2.c   alg2-2.c   alg5-1.c
      |                                          ^~~
main.c:83:53: error: invalid suffix "c" on floating constant
   83 | '#alg2-1.c#'  aig3-1.c   alg1-2.c   alg2-2.c   alg5-1.c
      |                                                     ^~~
main.c:84:1: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
   84 | '#alg5-2.c#'  aig3-1.c~  alg1-2.c~  alg2-2.c~  alg5-1.c~
      | ^~~~~~~~~~~~
main.c:84:20: error: invalid suffix "c" on floating constant
   84 | '#alg5-2.c#'  aig3-1.c~  alg1-2.c~  alg2-2.c~  alg5-1.c~
      |                    ^~~
main.c:84:31: error: invalid suffix "c" on floating constant
   84 | '#alg5-2.c#'  aig3-1.c~  alg1-2.c~  alg2-2.c~  alg5-1.c~
      |                               ^~~
main.c:84:42: error: invalid suffix "c" on floating constant
   84 | '#alg5-2.c#'  aig3-1.c~  alg1-2.c~  alg2-2.c~  alg5-1.c~
      |                                          ^~~
main.c:84:53: error: invalid suffix "c" on floating constant
   84 | '#alg5-2.c#'  aig3-1.c~  alg1-2.c~  alg2-2.c~  alg5-1.c~
      |                                                     ^~~
main.c:85:1: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
   85 | '#alg6-1.c#'  alg1-1     alg1-3.c   alg4-1.c   alg6-1.c
      | ^~~~~~~~~~~~
main.c:85:31: error: invalid suffix "c" on floating constant
   85 | '#alg6-1.c#'  alg1-1     alg1-3.c   alg4-1.c   alg6-1.c
      |                               ^~~
main.c:85:42: error: invalid suffix "c" on floating constant
   85 | '#alg6-1.c#'  alg1-1     alg1-3.c   alg4-1.c   alg6-1.c
      |                                          ^~~
main.c:85:53: error: invalid suffix "c" on floating constant
   85 | '#alg6-1.c#'  alg1-1     alg1-3.c   alg4-1.c   alg6-1.c
      |                                                     ^~~
main.c:86:40: error: invalid suffix "c" on floating constant
   86 | sshsv171:alg1 s1260011[53]$ emacs alg6-1.c
      |                                        ^~~