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 8631111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:10:20+00:00 2026-06-12T09:10:20+00:00

I am trying to make a program that shows what groceries the user ordered.

  • 0

I am trying to make a program that shows what groceries the user ordered. It will write in another file (when it’s complete) the data, and show the average of each food group. It goes like this:

#include<stdio.h>

int main()
{
    int beverage[3][20] = {
        "Soda"
        "Water"
        "Coffee"
    }; /* Here is 9 */
    int produce[3][20] = {
        "Apple"
        "Carrot"
        "Banana"
    }; /* Here is 14 */
    int dairy[3][20] = {
        "Milk"
        "Yogurt"
        "Cheese"
        }; /* Here is 19 */
    int dessert[3][20] = {
        "Ice Cream"
        "Cake"
        "Chocolate"
    }; /* Here is 24 */
    int meat[3][20] = {
        "Chicken"
        "Seafood"
        "Beef"
    }; /* Here is 29 */
    int grain[3][20] = {
        "Bread"
        "Muffin"
        "Cereal"
    }; /* Here is 34 */

    printf("Beverages: %p\n ", beverage[1]);
    printf("Produce: %p\n ", produce[2]);
    printf("Dairy: %p\n ", dairy[0]);
    printf("Candy: %p\n ", dessert[0]);
    printf("Meat: %p\n ", meat[2]);
    printf("Grain: %p\n ", grain[1]);

    return 0;
}

It shows the error message, “wide character array initialized from non-wide string,” in lines 9, 14, 19, 24, 29, and 34. So what does the error message mean to my code? How do I change it and where?

  • 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-12T09:10:21+00:00Added an answer on June 12, 2026 at 9:10 am

    If what you want are lists of strings (which I assume is what you want). You should be using char instead of int:

    char beverage[3][20] = {
        "Soda",
        "Water",
        "Coffee"
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a small program that will show a video from a
I am trying to make a program that will allow a user to view
I was trying to make the program write to a file that was named
I am trying to make a program that can take an .mp3 file from
I am trying to make a program that will find similar images from a
I am trying to make a simple program that will subtract an object from
I'm trying to make a program that creates and reads a binary file, which
I'm trying to make a simple program that shows that lets an image bob
I am trying to make a program that shows all the active applications. I
I'm new at Java GUI and I'm trying to make a program that shows

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.