Click here to Skip to main content
15,888,521 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to open and read/write from multiple serial ports at the same time? Pin
Code-o-mat17-Jul-11 21:36
Code-o-mat17-Jul-11 21:36 
GeneralRe: How to open and read/write from multiple serial ports at the same time? Pin
Le@rner17-Jul-11 21:38
Le@rner17-Jul-11 21:38 
GeneralRe: How to open and read/write from multiple serial ports at the same time? Pin
Code-o-mat17-Jul-11 21:52
Code-o-mat17-Jul-11 21:52 
GeneralRe: How to open and read/write from multiple serial ports at the same time? Pin
Le@rner17-Jul-11 22:05
Le@rner17-Jul-11 22:05 
GeneralRe: How to open and read/write from multiple serial ports at the same time? Pin
Code-o-mat17-Jul-11 22:35
Code-o-mat17-Jul-11 22:35 
GeneralMessage Removed Pin
16-Dec-11 0:14
Le@rner16-Dec-11 0:14 
GeneralRe: How to open and read/write from multiple serial ports at the same time? Pin
Code-o-mat16-Dec-11 0:29
Code-o-mat16-Dec-11 0:29 
Questionarray declaration Pin
Danzy8317-Jul-11 10:17
Danzy8317-Jul-11 10:17 
Hi experts, I am reading a source file written in C and there is a declaration syntax which is not familiar to me. The source file is from libmad mp3 decoder. When the file in which the declaration is made has a file extension of .c, the c++ compiler is able to compile successfully. I have changed the source file extension to .cpp but the compiler reports an error. When I looked at the line from where the error was reported, I saw an array declaration which I do not understand very well. This is how the array has been declared.

unsigned char (*main_data)[MAD_BUFFER_MDLEN];


The declaration has been made in a structure called mad_stream. I am not certain about the pointer (*main_data). The following assignment generates an error:

stream->main_data = malloc(MAD_BUFFER_MDLEN);


and Microsoft Visual Studio 2005 reports the following error:

.\mad\layer3.cpp(2531) : error C2440: '=' : cannot convert from 'void *' to 'unsigned char (*)[2567]'<br />


Could someone please explain to me what is happening? What should I do?. Thanks.
AnswerRe: array declaration Pin
Richard Andrew x6417-Jul-11 10:47
professionalRichard Andrew x6417-Jul-11 10:47 
GeneralRe: array declaration [modified] Pin
Danzy8317-Jul-11 11:56
Danzy8317-Jul-11 11:56 
GeneralRe: array declaration Pin
Richard Andrew x6417-Jul-11 13:45
professionalRichard Andrew x6417-Jul-11 13:45 
GeneralRe: array declaration Pin
Richard MacCutchan17-Jul-11 22:59
mveRichard MacCutchan17-Jul-11 22:59 
AnswerRe: array declaration Pin
«_Superman_»17-Jul-11 15:45
professional«_Superman_»17-Jul-11 15:45 
GeneralRe: array declaration Pin
Richard Andrew x6417-Jul-11 16:14
professionalRichard Andrew x6417-Jul-11 16:14 
GeneralRe: array declaration Pin
«_Superman_»17-Jul-11 16:33
professional«_Superman_»17-Jul-11 16:33 
GeneralRe: array declaration Pin
Richard Andrew x6417-Jul-11 17:32
professionalRichard Andrew x6417-Jul-11 17:32 
GeneralRe: array declaration Pin
Richard MacCutchan17-Jul-11 23:08
mveRichard MacCutchan17-Jul-11 23:08 
GeneralRe: array declaration Pin
«_Superman_»18-Jul-11 9:10
professional«_Superman_»18-Jul-11 9:10 
GeneralRe: array declaration Pin
Richard MacCutchan18-Jul-11 9:19
mveRichard MacCutchan18-Jul-11 9:19 
QuestionControlling microphone gain using "mixer" API? Pin
Vaclav_17-Jul-11 7:40
Vaclav_17-Jul-11 7:40 
AnswerRe: Controlling microphone gain using "mixer" API? Pin
Mark Salsbery17-Jul-11 11:46
Mark Salsbery17-Jul-11 11:46 
GeneralRe: Controlling microphone gain using "mixer" API? Pin
Vaclav_17-Jul-11 12:15
Vaclav_17-Jul-11 12:15 
QuestionVS 2010 and XP Pin
RomTibi16-Jul-11 23:45
RomTibi16-Jul-11 23:45 
AnswerRe: VS 2010 and XP Pin
Richard MacCutchan17-Jul-11 1:04
mveRichard MacCutchan17-Jul-11 1:04 
GeneralRe: VS 2010 and XP Pin
RomTibi17-Jul-11 8:50
RomTibi17-Jul-11 8:50 

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.