Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's wrong with the c++ code below?

Tags:

c++

syntax

HRESULT SaveGraphFile(IGraphBuilder *pGraph, WCHAR *wszPath) 
{
    const WCHAR wszStreamName[] = L"ActiveMovieGraph"; 
    HRESULT hr;
    IStorage *pStorage = NULL;

    // First, create a document file that will hold the GRF file
    hr = StgCreateDocfile(
         wszPath,
         STGM_CREATE │ STGM_TRANSACTED │ STGM_READWRITE │ 
            STGM_SHARE_EXCLUSIVE,
         0, &pStorage);
    ....

I copied it somewhere,but the compiler is reporting:

syntax error : missing ')' before identifier '│'

Why is | regarded an identifier ?

like image 323
user198729 Avatar asked Sep 08 '26 09:09

user198729


1 Answers

Your pipes aren't really pipes. The character between the STGM constants should be | (ASCII 124), but what you have is ¦ (ASCII 166, which isn't strictly speaking ASCII at all). It looks like you're the victim of a faulty copy-paste.

like image 91
JSBձոգչ Avatar answered Sep 09 '26 22:09

JSBձոգչ



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!