is there any difference between [ code=c ] and [ code=cplusplus ] ? I don't see the difference except, of course, the title. If no other difference why do we need both of them ?

Recommended Answers

All 13 Replies

They do highlight different keywords. That aside, the code bbcode is directly tied into the languages available in our code snippet library.

How come this highlights, then?

char* string;

string isn't a keyword in ANSI C.

> string isn't a keyword in ANSI C.
Neither in C++, its a class name. ;-)

>Neither in C++, its a class name.
But char is a keyword.

The thing highlights class names no differently from keywords.

char test;
cout << "Hello, world." << endl;

Hmm... further testing

char test;
cout << "Hello, world." << endl;

This is really confusing. :-(

I don't think true and false are keywords in ANSI C either, but it does recognize the difference with a couple keywords:

bool c = false;
int new, delete;
bool cpp = true;
int new, delete;
cout << "Hello, world!" << endl;
std::cout << "Hello, world!" << std::endl;
foo << "Hello, world!" << endl;

First, it could be invoked with [code=cpp] instead of cplusplus. Second, cout is just a value; it is not any more specialer than foo and shouldn't be highlighted any differently. I demand that you fix this within thirty minutes or else I'll tell people about the secret dinosaur sex image boards you have on this site.

commented: secret dinosaur sex image boards????? -3
commented: it was a joke? well if it was then you shouldn't be down repped +3

Umm ...... yeah. Like I said, I didn't write the parser. It's open source. Go complain to the project leaders.

secret dinosaur sex image boards

W-T-F

commented: This post is off-topic. -1
commented: Rashakil is a d-o-u-c-h-e +9
commented: WOW. what is wrong with him? I agree with josh. +15

also you would think that being opensource nerds they would know about proper use of C and C++

Umm ...... yeah. Like I said, I didn't write the parser. It's open source. Go complain to the project leaders.

If it's open source, that means you can go into geshi/cpp.php and change

'Keywords' => array(
			1 => 'color: #0000ff;',
			2 => 'color: #0000ff;',
			3 => 'color: #0000dd;',
			4 => 'color: #0000ff;'
			),

to

'Keywords' => array(
			1 => 'color: #0000ff;',
			2 => 'color: #0000ff;',
			3 => '',
			4 => 'color: #0000ff;'
			),
commented: stop being a smartass -3

I get a bad rep for being offtopic where you were the one who mentioned "secret dinosaur sex image boards" ??? . Its no wonder everyone hates you.

>Go complain to the project leaders.
OK, for me it's not a big deal. It's a little nitpick I have. (I seem to have a lot of those, don't I)

>Its no wonder everyone hates you.
No, it's just the people that are incapable of recognizing sarcasm that hate him.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.