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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:41:25+00:00 2026-05-26T20:41:25+00:00

I know the problem has been addressed a million times here, and I know

  • 0

I know the problem has been addressed a million times here, and I know it’s about the typesafety (or rather lack of it) of printf, but I would like some help with the fix since the prof completely refuses C++ solutions.
I have the following structure:

struct node  
{  
        char author[40];  
        char title[40];  
        float price;  
        int stock;  
        nod *next;          
};

I know for a fact that the info is properly stored and I’ve narrowed the problem down to the displaying function:

void display()                      
{    
   nod *nod;    
   nod=p;                           
   while(nod)                       
   {    
      printf("%s \t %s \t %e \t%d", &node->auhtor, &node->title, &node->price, &node->stock);         
      node=node->next;}                
      printf("\n");    
   }    
}    

What exactly do I need to change for it to display the same results as

cout<<nod->autor<<'\t'<<nod->titlu<<'\t'<<nod->pret<<'\t'<<nod->stoc<<endl;
  • 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-26T20:41:25+00:00Added an answer on May 26, 2026 at 8:41 pm

    Just remove all the ampersands. You want the real deal, so don’t apply the reference operator.

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

Sidebar

Related Questions

I know this topic has been addressed several times here, however my problem is
I know this has been discussed here many times, but none of the answers
I know this question has been asked before, but I ran into a problem.
I know this has been asked many times, and answered many times, but, all
Have youI know that the problem has been many times discussed in the web.
I don't know if anyone else even has this problem, or has noticed, but
I know that this has been discused before but i cant find an answer..
I know this topic has been beaten into the ground, but I'm really stumped.
I know this question has been asked before but I seem to have a
I have a problem which I don't know how to fix. It has to

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.