Click here to Skip to main content
12,758,605 members (32,313 online)

C / C++ / MFC

 
QuestionCasting structures - another basic question Pin
Vaclav_Sal24-Dec-12 5:38
memberVaclav_Sal24-Dec-12 5:38 
AnswerRe: Casting structures - another basic question Pin
Richard MacCutchan24-Dec-12 6:19
mvpRichard MacCutchan24-Dec-12 6:19 
GeneralSOLVED Casting structures - another basic question Pin
Vaclav_Sal24-Dec-12 9:04
memberVaclav_Sal24-Dec-12 9:04 
GeneralRe: SOLVED Casting structures - another basic question Pin
Erudite_Eric2-Jan-13 8:13
memberErudite_Eric2-Jan-13 8:13 
QuestionHow to count pages in PDF file using VC++ Pin
shanmugarajaa23-Dec-12 19:00
membershanmugarajaa23-Dec-12 19:00 
AnswerRe: How to count pages in PDF file using VC++ Pin
Richard MacCutchan23-Dec-12 23:04
mvpRichard MacCutchan23-Dec-12 23:04 
AnswerRe: How to count pages in PDF file using VC++ Pin
Jijo.Raj27-Dec-12 0:29
memberJijo.Raj27-Dec-12 0:29 
QuestionHow to implement C++ raw string literals in VIsual C++ 2010? Pin
Falconapollo22-Dec-12 19:03
memberFalconapollo22-Dec-12 19:03 
As you may already know, new string literals in C++ 11 can be expressed in a very flexible way.

R"<delim>...<delim>"; - in this code the <delim> can be pretty much everything and also no escape characters are needed. Any kind of parentheses can be used to delimit the end of string, Raw string literals are especially useful when defining regular expressions:

R"(I love those who yearn for the impossible. (Von Goethe, "Faust"))";

Blocks of text can be simply defined using equal occurrences of same characters:

R";***************************( ; TINY BASIC FOR INTEL 8080
; VERSION 2.0
; BY LI-CHEN WANG
; MODIFIED AND TRANSLATED
; TO INTEL MNEMONICS
; BY ROGER RAUSKOLB
; 10 OCTOBER, 1976
; @COPYLEFT
; ALL WRONGS RESERVED ) ;***************************";


More information can be found here http://en.wikipedia.org/wiki/C++0x#New_string_literals[^] (Wikipedia).

I want to implement it with C++ processor, here is what I have. Now double quotation marks are not supported, and I need to compete it like C++ 11. Can anyone help me?

#define STR(a) #a
#define R(var, re)  static char var##_[] = STR(re);\
const char * var = ( var##_[ sizeof(var##_) - 2] = '\0',  (var##_ + 1) );


You can use it like this:

R(re, "\w\d");//It's OK, no warnings.


The code is not friendly to use. So I want the feature like C++ 11 raw string literals.

PS: I'm using Visual C++ 2010, the new feature is not supported, I must implement it by myself.
Questionproblems returning/printing poiner Pin
doughyi8u20-Dec-12 15:16
memberdoughyi8u20-Dec-12 15:16 
AnswerRe: problems returning/printing poiner Pin
Jochen Arndt20-Dec-12 22:15
memberJochen Arndt20-Dec-12 22:15 
AnswerRe: problems returning/printing poiner Pin
Richard MacCutchan20-Dec-12 23:47
mvpRichard MacCutchan20-Dec-12 23:47 
GeneralRe: problems returning/printing poiner Pin
Jochen Arndt21-Dec-12 0:07
memberJochen Arndt21-Dec-12 0:07 
GeneralRe: problems returning/printing poiner Pin
Richard MacCutchan21-Dec-12 1:19
mvpRichard MacCutchan21-Dec-12 1:19 
QuestionC++ ownerdrawfixed combobox "header" Pin
NoviceEx19-Dec-12 3:49
memberNoviceEx19-Dec-12 3:49 
AnswerRe: C++ ownerdrawfixed combobox "header" Pin
jeron119-Dec-12 5:19
memberjeron119-Dec-12 5:19 
QuestionHow to make a project resolution independent.? Pin
mbatra3119-Dec-12 0:56
membermbatra3119-Dec-12 0:56 
AnswerRe: How to make a project resolution independent.? Pin
Jochen Arndt19-Dec-12 1:29
memberJochen Arndt19-Dec-12 1:29 
GeneralRe: How to make a project resolution independent.? Pin
mbatra3119-Dec-12 1:39
membermbatra3119-Dec-12 1:39 
GeneralRe: How to make a project resolution independent.? Pin
Jochen Arndt19-Dec-12 1:52
memberJochen Arndt19-Dec-12 1:52 
GeneralRe: How to make a project resolution independent.? Pin
mbatra3119-Dec-12 2:25
membermbatra3119-Dec-12 2:25 
GeneralRe: How to make a project resolution independent.? Pin
Jochen Arndt19-Dec-12 2:33
memberJochen Arndt19-Dec-12 2:33 
GeneralRe: How to make a project resolution independent.? Pin
mbatra3119-Dec-12 2:44
membermbatra3119-Dec-12 2:44 
GeneralRe: How to make a project resolution independent.? Pin
Jochen Arndt19-Dec-12 3:06
memberJochen Arndt19-Dec-12 3:06 
AnswerRe: How to make a project resolution independent.? Pin
Alan Balkany19-Dec-12 5:25
memberAlan Balkany19-Dec-12 5:25 
QuestionASM with stams library of C ++ Pin
Gurunathkudalkar18-Dec-12 22:15
memberGurunathkudalkar18-Dec-12 22:15 

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.


Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 21 Feb 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid