/ SeriousOJ /

Record Detail

Compile Error

foo.c: In function 'main':
foo.c:5:33: error: excess elements in 'char' array initializer
    5 |     char members[] = {"Hridoy", "Kamonasish", "Nayem", "Wasim", "Muzammal", "Shakib", "Mahfuz", "Shahadat"};
      |                                 ^~~~~~~~~~~~
foo.c:5:33: note: (near initialization for 'members')
foo.c:5:47: error: excess elements in 'char' array initializer
    5 |     char members[] = {"Hridoy", "Kamonasish", "Nayem", "Wasim", "Muzammal", "Shakib", "Mahfuz", "Shahadat"};
      |                                               ^~~~~~~
foo.c:5:47: note: (near initialization for 'members')
foo.c:5:56: error: excess elements in 'char' array initializer
    5 |     char members[] = {"Hridoy", "Kamonasish", "Nayem", "Wasim", "Muzammal", "Shakib", "Mahfuz", "Shahadat"};
      |                                                        ^~~~~~~
foo.c:5:56: note: (near initialization for 'members')
foo.c:5:65: error: excess elements in 'char' array initializer
    5 |     char members[] = {"Hridoy", "Kamonasish", "Nayem", "Wasim", "Muzammal", "Shakib", "Mahfuz", "Shahadat"};
      |                                                                 ^~~~~~~~~~
foo.c:5:65: note: (near initialization for 'members')
foo.c:5:77: error: excess elements in 'char' array initializer
    5 |     char members[] = {"Hridoy", "Kamonasish", "Nayem", "Wasim", "Muzammal", "Shakib", "Mahfuz", "Shahadat"};
      |                                                                             ^~~~~~~~
foo.c:5:77: note: (near initialization for 'members')
foo.c:5:87: error: excess elements in 'char' array initializer
    5 |     char members[] = {"Hridoy", "Kamonasish", "Nayem", "Wasim", "Muzammal", "Shakib", "Mahfuz", "Shahadat"};
      |                                                                                       ^~~~~~~~
foo.c:5:87: note: (near initialization for 'members')
foo.c:5:97: error: excess elements in 'char' array initializer
    5 |     char members[] = {"Hridoy", "Kamonasish", "Nayem", "Wasim", "Muzammal", "Shakib", "Mahfuz", "Shahadat"};
      |                                                                                                 ^~~~~~~~~~
foo.c:5:97: note: (near initialization for 'members')

Code

#include <stdio.h>

int main() {
    
    char members[] = {"Hridoy", "Kamonasish", "Nayem", "Wasim", "Muzammal", "Shakib", "Mahfuz", "Shahadat"};
    
    int total_members = sizeof(members) / sizeof(members[0]);
    
    printf("%d\n", total_members+100);
    
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1048 History of TLE_Headquarters
Contest
TLE_Headquarters - round #1
Language
C99 (GCC 13.2.0)
Submit At
2024-03-27 16:23:01
Judged At
2024-11-11 03:38:58
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes