GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rating: Thread Rating: 4 votes, 4.75 average.
  #11  
Old 07-Jun-2003, 03:33
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Man... I am so relieved that got fixed! I was so disappointed spending days figuring out the php to highlight code only to find the CSS screwing everything else up!

What's next? Oh yes, the email notifications...
  #12  
Old 28-Nov-2004, 14:04
koool_kid koool_kid is offline
Invalid Email Address
 
Join Date: Nov 2004
Posts: 8
koool_kid is on a distinguished road
c/c++ code:
// Hey emacs, this is a -*- C++ -*- file
#ifndef _STACK_H
#define _STACK_H

#include <stdexcept>
using namespace std;

template <typename T, int max> class Stack {
public:
// C'Tor for empty stacks
Stack() throw() {
top = 0;
}

// Add t to the top of the stack
void push(T t) {
if(isfull())
throw overflow_error("Stack overflow!");
contents[top++] = t;
}

// Remove and return the top of the stack
T pop(){
if(isempty())
throw underflow_error("Stack underflow!");
return contents[--top];
}

// Will push() succeed?
bool isfull(){
return top>= max;
}

// Will pop() succeed?
bool isempty(){
return top==0;
}
private:
int top;
T contents[max];

};

#endif
  #13  
Old 28-Nov-2004, 14:20
koool_kid koool_kid is offline
Invalid Email Address
 
Join Date: Nov 2004
Posts: 8
koool_kid is on a distinguished road
Testing Post
c/c++ code:
// Hey emacs, this is a -*- C++ -*- file
#ifndef _STACK_H
#define _STACK_H

#include <stdexcept>
using namespace std;

template <typename T, int max> class Stack {
public:
// C'Tor for empty stacks
Stack() throw() {
top = 0;
}

// Add t to the top of the stack
void push(T t) {
if(isfull())
throw overflow_error("Stack overflow!");
contents[top++] = t;
}

// Remove and return the top of the stack
T pop(){
if(isempty())
throw underflow_error("Stack underflow!");
return contents[--top];
}

// Will push() succeed?
bool isfull(){
return top>= max;
}

// Will pop() succeed?
bool isempty(){
return top==0;
}
private:
int top;
T contents[max];

};

#endif
  #14  
Old 28-Nov-2004, 14:24
koool_kid koool_kid is offline
Invalid Email Address
 
Join Date: Nov 2004
Posts: 8
koool_kid is on a distinguished road
Another test
CPP / C++ / C Code:
///* comment this line only
int JustABaseClass::setSomeString(const std::string &value)
{
  somePublicString = value;
}
//*/

/* comment everything here
int JustABaseClass::setSomeString(const std::string &value)
{
  somePublicString = value;
}
//*/

///* comment this line only
int JustABaseClass::setSomeString(const std::string &value)
{
  somePublicString = value;
}
//*/
  #15  
Old 28-Nov-2004, 23:16
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,335
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
You could have saved yourself time and saved us from new posts by clicking "Preview" insted of "Submit". This would be a good thing to do always to make sure your post will look the way you want before hitting "Submit"...
__________________

During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence?
  #16  
Old 12-Dec-2005, 08:54
balusss balusss is offline
Junior Member
 
Join Date: Dec 2005
Posts: 64
balusss is on a distinguished road

Re: GIDForums enables New [C] / [C++] bbcode.


it is not clear. how can i get those seperate windows for my code part.
  #17  
Old 12-Dec-2005, 13:10
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,335
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all

Re: GIDForums enables New [C] / [C++] bbcode.


Surround the code with [C] and [/C]:

This is your problem explanation. Now you want code:

[C]
CPP / C++ / C Code:
#include <iostream>
int main()
{
    int test;
[/C]

Now type more explanation. More code? no problem

[C]
CPP / C++ / C Code:
    }
    cout << ans << " is your result" << endl;
    return(0);
}
[/C]

Now finish off your post.

Be sure to click PREVIEW to see that everything looks right before clicking on SUBMIT. And don't forget to read the Guidelines
__________________

During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence?
  #18  
Old 17-Jul-2007, 04:11
anusha anusha is offline
New Member
 
Join Date: Jul 2007
Posts: 1
anusha is on a distinguished road

Re: GIDForums enables New [C] / [C++] bbcode.


please send me some pointer example programs
  #19  
Old 23-Aug-2008, 15:57
Alan Alan is offline
New Member
 
Join Date: Aug 2008
Location: London UK
Posts: 10
Alan is on a distinguished road

Re: GIDForums enables New [C] / [C++] bbcode.


Yep
CPP / C++ / C Code:
int main ( ) { return ( 0 ) ; }
But as I intended this as C , it is a pity that it is headed as you see.
Why not head the box with
CPP / C++ / C Code:
code
or even no heading at all, putting more onto the monitor and offending no-one.
Keep up the good work.
  #20  
Old 25-Aug-2008, 04:34
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 1,032
LuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the rough

Re: GIDForums enables New [C] / [C++] bbcode.


Quote:
Originally Posted by Alan
Yep
CPP / C++ / C Code:
int main ( ) { return ( 0 ) ; }
But as I intended this as C , it is a pity that it is headed as you see.
Why not head the box with
CPP / C++ / C Code:
code
or even no heading at all, putting more onto the monitor and offending no-one.
Keep up the good work.

I am not sure I got the problem; would you like for C code to have the heading "code" instead of "CPP / C++ / C Code"? How would that be better? Isn't the current heading more accurate?
__________________
Please read these Guidelines before posting on the forum

"A person who never made a mistake never tried anything new."
Einstein
 
 

Recent GIDBlogAccepted for Ph.D. program by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Php bbcode issue Caged MySQL / PHP Forum 3 06-Aug-2003 19:55
GIDForums enables New [KBD] bbcode. admin GIDForums™ 0 24-Jul-2003 07:26
GIDForums enables New [CSS] bbcode. admin GIDForums™ 0 02-Jun-2003 00:57
GIDForums enables New HTML BBCode. admin Web Design Forum 0 17-Feb-2003 16:52

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 22:34.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.