- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
Student
- Interests
- C++
- PC Specs
- C++
8 Posted Topics
Re: [QUOTE=evilsilver]I use Borland aswell (i like it personally) as for the compiler it is just the play button (labeled as run) and when you say you click on the icon and it dissapears right away, are you talking about the Borland program itself, or the program you are trying to … | |
Always use scanf() and printf(). They are much, much faster than cin and cout. Also use stl algorithms, like sort, reverse and find, especialy if they are member functions of a container class you use. | |
Re: that is half c, half c++. If you want a code in C++, it would look like this: [CODE]#include <iostream> #include <string> using namespace std; int main( void ) { string name; char buff[257]; cout << "Your name: "; cin.getline( buff, 257 ); name = buff; cout << "Your name … | |
Re: [QUOTE=bitforce]An easy way to swap 2 variables without using another variable: [CODE]a=a+b; b=a-b; a=a-b;[/CODE][/QUOTE] it can't be used if operator+ and operator- arn't defined!!! and you don't have to use another variable, in C++ standard, there is the STL. It is the strength of C++ because there are lots and … | |
Re: this should work... [CODE]#include <cstdio> #include <algorithm> #include <string> using namespace std; const int NULA = 0; string a, b; char buff[1026]; int main (void) { while( scanf( "\n%s", buff ) == 1 ) { b = a = buff; reverse( b.begin(), b.end() ); if( a == b ) printf( … | |
Re: Haven't you guys heard for sprintf()? it is used as printf(), just the first element must be a *char. They are defined in header cstdio. | |
Re: Do you know what is the definition of the prime number? It is a number that has no other diveders other than one and itself. You tested the number to itself (every number devides it self, doesn't it?) so that is why the function always return false. If the number … | |
Re: [url]http://mathworld.wolfram.com/GammaFunction.html[/url] go to that page if you don't know what is the gamma funcition. |
The End.