Click here to Skip to main content
15,798,508 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MultiThread Question Pin
Jochen Arndt8-Jan-18 4:00
professionalJochen Arndt8-Jan-18 4:00 
GeneralRe: MultiThread Question Pin
ForNow8-Jan-18 4:03
ForNow8-Jan-18 4:03 
Questionarray and pointer Pin
Anonygeeker7-Jan-18 19:02
Anonygeeker7-Jan-18 19:02 
AnswerRe: array and pointer Pin
Rick York7-Jan-18 19:56
mveRick York7-Jan-18 19:56 
AnswerRe: array and pointer Pin
CPallini7-Jan-18 22:44
mveCPallini7-Jan-18 22:44 
AnswerRe: array and pointer Pin
cao_aba39-Jan-18 16:55
cao_aba39-Jan-18 16:55 
GeneralRe: array and pointer Pin
Richard MacCutchan9-Jan-18 23:26
mveRichard MacCutchan9-Jan-18 23:26 
QuestionWhat am I doing wrong defining single bit? Pin
Vaclav_7-Jan-18 13:36
Vaclav_7-Jan-18 13:36 
I am Using GCC running on Linux / Ubuntu

gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4)

I need / like to have a single bit variable / flag passed to / from SPI hardware.

Single bit defined

// need for SPI /I2C
typedef unsigned char bit : 1; // single bit

Implemented

char x;
static bit b; // defined in generic def header


Compiler error - what initializer is missing?


In file included from ../src/MODULES/M_SPI/CASPI.h:53Blush | :O ,
from ../src/MODULES/M_SPI/CASPI.cpp:34:
/media/os64/Eclipse/eclipse/Workspace/Eclipse_Oxygen_1A/VNA_2/src/MODULES/MODULE_1602/C_GenericTypeDefs.h:77:33: error: expected initializer before ‘:’ token
typedef unsigned char bit : 1; // single bit
^
../src/MODULES/M_SPI/CASPI.cpp:239:1: error: ‘bit’ does not name a type
bit C_SPIClass::I2CTX(unsigned char d) {
^

Thanks for any help.
Cheers
AnswerRe: What am I doing wrong defining single bit? Pin
leon de boer7-Jan-18 16:23
leon de boer7-Jan-18 16:23 
GeneralRe: What am I doing wrong defining single bit? Pin
Vaclav_8-Jan-18 6:37
Vaclav_8-Jan-18 6:37 
QuestionC program to reverse the order of the words entered. Pin
Tarun Jha7-Jan-18 7:45
Tarun Jha7-Jan-18 7:45 
GeneralRe: C program to reverse the order of the words entered. Pin
PIEBALDconsult7-Jan-18 8:01
professionalPIEBALDconsult7-Jan-18 8:01 
SuggestionRe: C program to reverse the order of the words entered. Pin
David Crow7-Jan-18 16:50
David Crow7-Jan-18 16:50 
QuestionWrite data to file which cannot be viewed Pin
manoharbalu5-Jan-18 3:09
manoharbalu5-Jan-18 3:09 
SuggestionRe: Write data to file which cannot be viewed Pin
David Crow5-Jan-18 3:16
David Crow5-Jan-18 3:16 
AnswerRe: Write data to file which cannot be viewed Pin
Richard MacCutchan5-Jan-18 3:35
mveRichard MacCutchan5-Jan-18 3:35 
AnswerRe: Write data to file which cannot be viewed Pin
jschell5-Jan-18 14:45
jschell5-Jan-18 14:45 
AnswerRe: Write data to file which cannot be viewed Pin
leon de boer6-Jan-18 5:45
leon de boer6-Jan-18 5:45 
QuestionWriting a huge structure data to file Pin
manoharbalu4-Jan-18 23:29
manoharbalu4-Jan-18 23:29 
AnswerRe: Writing a huge structure data to file Pin
Richard MacCutchan5-Jan-18 0:27
mveRichard MacCutchan5-Jan-18 0:27 
AnswerRe: Writing a huge structure data to file Pin
jschell5-Jan-18 14:49
jschell5-Jan-18 14:49 
AnswerRe: Writing a huge structure data to file Pin
leon de boer6-Jan-18 5:11
leon de boer6-Jan-18 5:11 
QuestionHow to return a string from a user defined function to main function ? Pin
Tarun Jha3-Jan-18 4:21
Tarun Jha3-Jan-18 4:21 
AnswerRe: How to return a string from a user defined function to main function ? Pin
David Crow3-Jan-18 7:24
David Crow3-Jan-18 7:24 
GeneralRe: How to return a string from a user defined function to main function ? Pin
Tarun Jha3-Jan-18 8:20
Tarun Jha3-Jan-18 8:20 

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.