Click here to Skip to main content
15,849,785 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 22:52
Code-o-mat17-Jul-11 22:52 
GeneralRe: How to open and read/write from multiple serial ports at the same time? Pin
Le@rner17-Jul-11 23:05
Le@rner17-Jul-11 23:05 
GeneralRe: How to open and read/write from multiple serial ports at the same time? Pin
Code-o-mat17-Jul-11 23:35
Code-o-mat17-Jul-11 23:35 
GeneralMessage Removed Pin
16-Dec-11 1:14
Le@rner16-Dec-11 1:14 
GeneralRe: How to open and read/write from multiple serial ports at the same time? Pin
Code-o-mat16-Dec-11 1:29
Code-o-mat16-Dec-11 1:29 
Questionarray declaration Pin
Danzy8317-Jul-11 11:17
Danzy8317-Jul-11 11:17 
AnswerRe: array declaration Pin
Richard Andrew x6417-Jul-11 11:47
professionalRichard Andrew x6417-Jul-11 11:47 
GeneralRe: array declaration [modified] Pin
Danzy8317-Jul-11 12:56
Danzy8317-Jul-11 12:56 
Right Richie, but do you have any idea how I should allocate the memory in C++ with the new operator for it to work? I still can't figure it out.

For instance, I was playing with this syntax in both C and C++. As an example, the following code compiled successfully when the file extension was .c:

#include <stdio.h>


int main(void)
{
    char (*ptr)[40];

    ptr = malloc(40);

    // some code...
    
    free(ptr);

    return 0;

}


However, by just changing the source file to .cpp, the code doesn't compile. Anyway of accomplishing this in C++?

modified on Sunday, July 17, 2011 7:14 PM

GeneralRe: array declaration Pin
Richard Andrew x6417-Jul-11 14:45
professionalRichard Andrew x6417-Jul-11 14:45 
GeneralRe: array declaration Pin
Richard MacCutchan17-Jul-11 23:59
mveRichard MacCutchan17-Jul-11 23:59 
AnswerRe: array declaration Pin
«_Superman_»17-Jul-11 16:45
professional«_Superman_»17-Jul-11 16:45 
GeneralRe: array declaration Pin
Richard Andrew x6417-Jul-11 17:14
professionalRichard Andrew x6417-Jul-11 17:14 
GeneralRe: array declaration Pin
«_Superman_»17-Jul-11 17:33
professional«_Superman_»17-Jul-11 17:33 
GeneralRe: array declaration Pin
Richard Andrew x6417-Jul-11 18:32
professionalRichard Andrew x6417-Jul-11 18:32 
GeneralRe: array declaration Pin
Richard MacCutchan18-Jul-11 0:08
mveRichard MacCutchan18-Jul-11 0:08 
GeneralRe: array declaration Pin
«_Superman_»18-Jul-11 10:10
professional«_Superman_»18-Jul-11 10:10 
GeneralRe: array declaration Pin
Richard MacCutchan18-Jul-11 10:19
mveRichard MacCutchan18-Jul-11 10:19 
QuestionControlling microphone gain using "mixer" API? Pin
Vaclav_17-Jul-11 8:40
Vaclav_17-Jul-11 8:40 
AnswerRe: Controlling microphone gain using "mixer" API? Pin
Mark Salsbery17-Jul-11 12:46
Mark Salsbery17-Jul-11 12:46 
GeneralRe: Controlling microphone gain using "mixer" API? Pin
Vaclav_17-Jul-11 13:15
Vaclav_17-Jul-11 13:15 
QuestionVS 2010 and XP Pin
RomTibi17-Jul-11 0:45
RomTibi17-Jul-11 0:45 
AnswerRe: VS 2010 and XP Pin
Richard MacCutchan17-Jul-11 2:04
mveRichard MacCutchan17-Jul-11 2:04 
GeneralRe: VS 2010 and XP Pin
RomTibi17-Jul-11 9:50
RomTibi17-Jul-11 9:50 
GeneralRe: VS 2010 and XP Pin
RomTibi17-Jul-11 18:45
RomTibi17-Jul-11 18:45 
GeneralRe: VS 2010 and XP Pin
Richard MacCutchan17-Jul-11 23:47
mveRichard MacCutchan17-Jul-11 23:47 

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.