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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:40:28+00:00 2026-05-25T15:40:28+00:00

I am new in C programming, and trying to create simple code below for

  • 0

I am new in C programming, and trying to create simple code below for printing a struct member using other function.

I do not understand this, as in the function funct_to_print_value, I already declare the struct variable “car”, and I believe what I need is just to print is using (dot) notation to access it. Appereantly not, as I got the error above. Does anyone can share their knowledge, how I can print the value of buyer, and what mistake I had done above?

Thank you ..

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


typedef struct slot_car {
    int buyer;
} slot_car;



int main() {



    slot_car car;
    memset(&car, 0, sizeof(car));
    car.buyer = 1;

    printf("value of car is .. %d\n", car.buyer);

    funct_to_print_value();
    printf("end of function..\n");
    return 0;
}

int funct_to_print_value()
{
    printf("you are in printlist function..\n");
    slot_car car;
    printf("value of car inside is %d\n", car.buyer);

    return 1;
}
  • 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-05-25T15:40:28+00:00Added an answer on May 25, 2026 at 3:40 pm

    Since you declared car inside each function separately, they are separate (local) variables. You probably want to pass it from main to funct_to_print_value as a parameter instead. The warning is strange, but it is possible that the compiler detected the uninitiated value and gave this message because it is first used in printf.

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

Sidebar

Related Questions

I'm new to programming for the android and I'm trying to create a simple
I'm new to graphics programming. I'm trying to create a program that allows you
I'm new to iPhone programming, and I'm trying to make a simple program without
I'm new to Flash Pro programming, and am trying to create a button-type symbol
Hello im new to programming, im trying to construct my first simple application, im
I am new to thread programming in Java. To understand threading I'm trying to
I'm new to OO programming, and I'm trying to understand how to assign values
I am new to socket programming and trying to write a simple cmd line
Hi I'm new to Android Programming and I'm trying to make a simple program
i been thinking of a new programming language. Before trying to implement it i

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.