Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8882295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:32:32+00:00 2026-06-14T20:32:32+00:00

I’ve some warnings while trying to compile program in C language: 13:20: warning: excess

  • 0

I’ve some warnings while trying to compile program in C language:

13:20: warning: excess elements in array initializer [enabled by default]

13:20: warning: (near initialization for ‘litera’) [enabled by default]

22:18: warning: excess elements in array initializer [enabled by default]

22:18: warning: (near initialization for ‘liczba’) [enabled by default]

43:1: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat]

45:2: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat]

55:2: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat]

The source is:

char litera[63] = {'E', 'G', 'H', 'F', 'E', 'G', 'H', 'F',
                   'D', 'B', 'A', 'C', 'D', 'B', 'A', 'C', 
                   'B', 'A', 'C', 'D', 'C', 'A', 'B', 'D', 
                   'F', 'H', 'G', 'E', 'F', 'H', 'G', 'E', 
                   'C', 'D', 'B', 'A', 'B', 'A', 'C', 'D', 
                   'F', 'E', 'G', 'H', 'G', 'H', 'F', 'G', 
                   'H', 'F', 'E', 'F', 'H', 'G', 'E', 'C',
    /*line13:*/    'A', 'B', 'D', 'C', 'A', 'B', 'D', 'E'};

int liczba[63] ={'8', '7', '5', '6', '4', '3', '1', '2', 
                 '1', '2', '4', '3', '5', '6', '8', '7', 
                 '5', '7', '8', '6', '4', '3', '1', '2', 
                 '1', '2', '4', '3', '5', '6', '8', '7', 
                 '6', '8', '7', '5', '3', '1', '2', '4', 
                 '3', '1', '2', '4', '6', '8', '7', '5', 
                 '7', '8', '6', '4', '3', '1', '2', '1', 
    /*line22*/   '2', '4', '3', '5', '6', '8', '7', '5'};


int i=0, x=0, n;
char a;
int b=0;
printf("Podaj literę z pola startowego skoczka(duże litery)\n");
scanf("%s", &a);
printf("Podaj liczbę z pola startowego skoczka \n");
scanf("%d", &b);

if (b<=0 || b>8){
    printf("Zła pozycja skoczka\n");
    return 0;
    }

while (litera[i] != a || liczba[i] != b){
    ++i;
    }
n=i;

/*line43*/ printf("Trasa skoczka od punktu %s %d to:\n", a, b); 
while (i<=64){
/*line45*/ printf("%s%d ", litera[i], liczba[i]);
    ++i;

    ++x;
    x=x%8;
    if(x==0)
        printf("/n");
    }
i=0;
while (i<n){
/*line55*/ printf("%s%d ", litera[i], liczba[i]);

    ++i;

    ++x;
    x=x%8;
    if(x==0)
        printf("/n");
    }

also I have “core dumped” after scanf("%d", &b);, but int b=0; doesn’t make a problem…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:32:33+00:00Added an answer on June 14, 2026 at 8:32 pm

    Two errors here: first, you’re trying to declare arrays[63] for storing 64 elements, as you’ve probably confused the size of array (n) with the maximum possible index value (that’s n - 1). So it definitely should be litera[64] and liczba[64]. BTW, you have to change this line too – while (i<=64): otherwise you end up trying to access 65th element.

    And second, you’re trying to fill char value with %s format specifier for scanf, while you should have used %c here.

    Also, can’t help wondering why you declare liczba array as one that stores ints, that initialize it with array of chars. All these ‘1’, ‘2’, etc… literals represent NOT the corresponding digits – but the charcodes for them. I doubt that was your intent.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
For some reason, after submitting a string like this Jack’s Spindle from a text
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have an array which has BIG numbers and small numbers in it. I
I'm trying to select an H1 element which is the second-child in its group

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.