Macheda signs for Cardiff
The Italian will join Ole Gunnar Solskjaer's men on a free transfer on July 1, when his contract at Manchester United expires.
Macheda had spells on loan at both Doncaster Rovers and Birmingham City in the Championship last season, and was particularly impressive at St Andrews, where he scored 10 goals in 18 appearances.
Cardiff will hope the 22-year-old can show that sort of form in the second tier once again next season, as the Welsh outfit look to bounce back to the Premier League at the first attempt following their relegation.
Macheda, who worked with Solskjaer at United, identified the Norwegian as the main reason for his decision to join the club.
"It's a massive opportunity for me and it is with thanks to Ole Gunnar Solskjaer that I am here," he told the club's official website.
"He played a big part of my decision and I'm really looking forward to starting this season.
"Last season I had a good spell on loan at Birmingham City, but this is a new chapter of my career now and I can't wait to get started and show everyone who I am.
"Knowing Ole, he wants to get back into the Premier League as soon as possible and the recent signings show that.
"I'm here for the same reason. I feel that this is a great team and if we can have a good season and work hard then we can go straight back up."