Click here to Skip to main content
15,891,316 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: eliminating lag from a chess clock Pin
Randor 16-Dec-18 23:09
professional Randor 16-Dec-18 23:09 
GeneralRe: eliminating lag from a chess clock Pin
Alexander Kindel18-Dec-18 14:41
Alexander Kindel18-Dec-18 14:41 
GeneralRe: eliminating lag from a chess clock Pin
Daniel Pfeffer18-Dec-18 20:27
professionalDaniel Pfeffer18-Dec-18 20:27 
QuestionWiFi Notifications [SOLVED] Pin
Richard Andrew x6414-Dec-18 16:13
professionalRichard Andrew x6414-Dec-18 16:13 
QuestionVC++ Word automation issues on Win 10 Pin
narasingubhanu14-Dec-18 2:25
narasingubhanu14-Dec-18 2:25 
AnswerRe: VC++ Word automation issues on Win 10 Pin
Richard MacCutchan14-Dec-18 4:47
mveRichard MacCutchan14-Dec-18 4:47 
GeneralRe: VC++ Word automation issues on Win 10 Pin
narasingubhanu14-Dec-18 19:04
narasingubhanu14-Dec-18 19:04 
QuestionInitializing struct (in C++) Pin
Vaclav_12-Dec-18 6:22
Vaclav_12-Dec-18 6:22 
I hope this is not going to be another one of "read the book" discussion.
( And if you already do not like my remark, do not read the rest of this post)

This is very simple , but as always I am not sure about using correct terminology.
The attached code , struct variable , is taken from C code tutorial.
gcc++ compiler generates this error
sorry, unimplemented: non-trivial designated initializers not supported


Mrs Google say it is because gcc++ does not like C style "reference" "." It also say not to use "=" , but use ":" .

OK, I generally can follow instructions , BUT
If I do not use "." my IDE won't supply all available "options" anymore.

No big deal, in this case, however I like to know if I can change some options in gcc++ or if this a IDE "issue".


C++
	/* this is C construct
	struct spi_ioc_transfer tr = {
		.tx_buf = (unsigned long)tx,
		.rx_buf = (unsigned long)rx,
		.len = ARRAY_SIZE(tx),
//		.delay_usecs = delay,
		.speed_hz = 0,
		.bits_per_word = 0,
	};

generates error sorry, unimplemented: non-trivial designated initializers not supported
	*/
	struct spi_ioc_transfer tr = {
		tx_buf:(unsigned long)tx,

this works fine no error 

		//tx_buf
		//.tx_buf = (unsigned long)tx,
		//.rx_buf = (unsigned long)rx,
		//.len = ARRAY_SIZE(tx),
//		.delay_usecs = delay,
	//	.speed_hz = 0,
	//	.bits_per_word = 0,
	};

AnswerRe: Initializing struct (in C++) Pin
leon de boer12-Dec-18 6:28
leon de boer12-Dec-18 6:28 
QuestionList HDD files in CListView Pin
_Flaviu11-Dec-18 1:22
_Flaviu11-Dec-18 1:22 
AnswerRe: List HDD files in CListView Pin
Richard MacCutchan11-Dec-18 6:00
mveRichard MacCutchan11-Dec-18 6:00 
GeneralRe: List HDD files in CListView Pin
_Flaviu11-Dec-18 7:52
_Flaviu11-Dec-18 7:52 
GeneralRe: List HDD files in CListView Pin
Richard MacCutchan11-Dec-18 22:01
mveRichard MacCutchan11-Dec-18 22:01 
SuggestionRe: List HDD files in CListView Pin
David Crow11-Dec-18 13:27
David Crow11-Dec-18 13:27 
GeneralRe: List HDD files in CListView Pin
_Flaviu11-Dec-18 22:36
_Flaviu11-Dec-18 22:36 
SuggestionRe: List HDD files in CListView Pin
David Crow12-Dec-18 2:53
David Crow12-Dec-18 2:53 
GeneralRe: List HDD files in CListView Pin
_Flaviu12-Dec-18 23:15
_Flaviu12-Dec-18 23:15 
QuestionDriving Ctatic::DrawItem Pin
ForNow10-Dec-18 15:16
ForNow10-Dec-18 15:16 
AnswerRe: Driving Ctatic::DrawItem Pin
ForNow11-Dec-18 15:58
ForNow11-Dec-18 15:58 
Question有什么学习途径 Pin
Member 140765679-Dec-18 20:30
Member 140765679-Dec-18 20:30 
SuggestionRe: What is the learning path? Pin
Richard Deeming11-Dec-18 1:09
mveRichard Deeming11-Dec-18 1:09 
QuestionAfxMessage doesn’t block Pin
ForNow6-Dec-18 2:02
ForNow6-Dec-18 2:02 
AnswerRe: AfxMessage doesn’t block Pin
Victor Nijegorodov6-Dec-18 5:22
Victor Nijegorodov6-Dec-18 5:22 
GeneralRe: AfxMessage doesn’t block Pin
ForNow6-Dec-18 5:26
ForNow6-Dec-18 5:26 
GeneralRe: AfxMessage doesn’t block Pin
Victor Nijegorodov6-Dec-18 8:45
Victor Nijegorodov6-Dec-18 8:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.