Forum: C++ Jul 27th, 2008 |
| Replies: 11 Views: 2,875 hi,
you may read this
http://gcc.gnu.org/
or that
http://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/G_002b_002b-and-GCC.html |
Forum: C++ Jul 26th, 2008 |
| Replies: 11 Views: 2,875 possibly #include <iostream> or using namespace std forgotten.
That also works: return answer == 'y' ;
instead of: if ( answer == 'y' ) return true; else return false;
krs,
tesu |
Forum: C++ Jul 9th, 2008 |
| Replies: 1 Views: 534 yeah, aaaaaand the ardently demanding question is what does that only mean:
>> merge function is not working at all ?
Any error message, divide by zero, memory fault, endless loops, computer... |
Forum: C++ Jul 9th, 2008 |
| Replies: 13 Views: 2,510 You may study programming languages like FORTH or Postscript how they do computing using stacks.
tesu |
Forum: C++ Jul 4th, 2008 |
| Replies: 4 Views: 1,732 Hi
possibly you want that second array of chars behaves like first on, as in:
int main() {
unsigned char apayload[] = {'H','i',' ','T','h','e','r','e', '\0'};
unsigned char... |
Forum: C++ Jul 2nd, 2008 |
| Replies: 3 Views: 1,032 Hello
depending on how many "grams" will be processed, that is eliminating duplicates, comparing two sets of "grams", hashing method is best method, it is of O(1). And compared with other... |
Forum: C++ Jun 30th, 2008 |
| Replies: 11 Views: 1,310 howdy
Is this problem not roaring for herd of lex, yacc, flex, gnus, bison?
Also Aho and Sethi might be involved
krs,
tesu |
Forum: C++ Jun 27th, 2008 |
| Replies: 16 Views: 1,753 Oh, Lady Be Good :twisted: |
Forum: C++ Jun 26th, 2008 |
| Replies: 1 Views: 1,658 This is also what I am looking for. Unfortunately, NetBeans 6.1 seems to have some errors because tutorials from version 6.0 don't run, also not able to assign gcc compilers. It is said that there... |
Forum: C++ Jun 26th, 2008 |
| Replies: 23 Views: 4,403 Hello Shaun32887
following is a small class what has been posted by a programming virtuoso here in forum on daniweb.com. Unfortunately, I have not recorded his name.
//
// String passing... |
Forum: C++ Jun 26th, 2008 |
| Replies: 4 Views: 596 No, it's just a tit-for-tat response :icon_mrgreen: |
Forum: C++ Jun 26th, 2008 |
| Replies: 4 Views: 596 Hello,
your idea of using <bitset> is completely correct. You only need to make some improvements like in:
int main(){
const int n=3, d=1<<n;
for (int... |
Forum: C++ Jun 26th, 2008 |
| Replies: 9 Views: 3,164 Well, I can do but don't like to do that. Why not reacting to my suggestions first? Also, if one gets at least 100 errors, wouldn't it be great to post some of them?
krs,
tesu |
Forum: C++ Jun 25th, 2008 |
| Replies: 9 Views: 3,164 What's your specific problem, any error messages? did you create all needed handles (SQL_HANDLE_ENV, SQL_HANDLE_DBC, SQL_HANDLE_STMD) properly. did you figure out correct connection string for SQL... |
Forum: C++ Jun 24th, 2008 |
| Replies: 6 Views: 1,068 instead of: int i = ch; // stores same code in an int (wrongly)
you might try: int*i =(int*)ch;
then
cin>>ch; // enter A for example
cout << ch; // gives A
cout << i; // gives 0x41... |
Forum: C++ Jun 24th, 2008 |
| Replies: 3 Views: 1,067 ???????????
What do you want to do?
krs,
tesu |
Forum: C++ Jun 23rd, 2008 |
| Replies: 6 Views: 1,068 Hi
Your code:
char ch;
int i = ch;
You didn't assign a value to ch. So i is undefined. Also this would not work if you do cin >> ch.
You may try this instead:
char xxx = 'x'; |
Forum: C++ Jun 22nd, 2008 |
| Replies: 10 Views: 602 Apparently, he is thinking of hacking SQL Server by some C++ code !
Planning this, at least he needs some detailed knowledge about xxxx_getinfo(), . . .
krs,
tesu
p.s. he is kindly... |
Forum: C++ Jun 22nd, 2008 |
| Replies: 5 Views: 2,175 hey,
you may try recursive function baseb:
void baseb(int b, string fi, unsigned int nb, string &f){
int p = nb % b; nb = nb / b;
if ( nb > 0) baseb(b, fi, nb, f);
f=f+fi[p];
}... |
Forum: C++ Jun 22nd, 2008 |
| Replies: 8 Views: 840 Well dear Superfat, the most effective solution for you problem has already been given by vijayan121. Unfortunately you aren't able to understand his fine function. So GOD's advice should be... |
Forum: C++ Jun 19th, 2008 |
| Replies: 2 Views: 1,627 Usually Borland c++ Version 5 does not need special configuration after proper installation from original (or even copied) CD, except one tries to install a plain disk copy of an already installed... |
Forum: C++ Jun 18th, 2008 |
| Replies: 6 Views: 1,949 thx :zzz:
Here is a great solution of the n queens problem. It originates from Niklaus Wirth, inventor of Pascal, Modula, and Oberon, over 30 years ago. His solution is unique, and I need some... |
Forum: C++ Jun 18th, 2008 |
| Replies: 6 Views: 1,949 sorry, completely nonsense what I wrote ! so forget it.
true, new <--> delete and malloc <--> free
sorry for telling that nonsens
krs,
tesu |
Forum: C++ Jun 18th, 2008 |
| Replies: 6 Views: 1,949 Hi mrboolf,
Consider your constructor and destructor:
In C++ memory is allocated by applying "new". Its partner is "free" ! You should never apply "delete", which is plain C, on memory... |
Forum: C++ Jun 17th, 2008 |
| Replies: 9 Views: 1,488 hi
you may try this
int main(int argc, char *argv[]){
cout << "Program name: " << argv[0] << endl;
cout << "Numbers of Parameters: " << argc << endl << "Parameters:\n";
for(int i=1;... |
Forum: C++ Jun 17th, 2008 |
| Replies: 4 Views: 809 There is a toggle key on your keyboard labelled 0 INS. If you hit it once, your keyboard will behave as you are asking for, char will be inserted. Hit it twice and your keyboard overwrites next char... |
Forum: C++ Jun 17th, 2008 |
| Replies: 6 Views: 837 malloc ?? this is not c++, maybe plain c
--> new
34 GB ?? 2 bytes just allow 2,1 GB to be addressed by |
Forum: C++ Jun 17th, 2008 |
| Replies: 2 Views: 683 NY local time = UTC - 5 or -4 (daylight saving time) |
Forum: C++ Jun 17th, 2008 |
| Replies: 12 Views: 2,169 Hi all,
I would never suggest beginners to program considerable GUIs by using MSDN because it may last until the cow comes home as Ancient Dragon already pointed out. Maybe a better and clearer... |
Forum: C++ Jun 17th, 2008 |
| Replies: 2 Views: 1,110 hi tusharvichare
The new net framework has a nice xml class containing almost all methods you need to work with xml.
krs,
tesu |
Forum: C++ Jun 16th, 2008 |
| Replies: 12 Views: 2,639 Hi niek_e
You are right, I have overlooked the semicolon at he far right.
Intuitively I also would put a semicolon at left side if for-init statement is off. But the ISO standard tells the... |
Forum: C++ Jun 16th, 2008 |
| Replies: 12 Views: 2,639 Hi QuantNeeds
Your for loop is correct. It corresponds completely with the Standard ISO/IEC 14882:1998(E) of C++. So your compiler seems to be something outdated, especially the phrase... |
Forum: C++ Jun 14th, 2008 |
| Replies: 4 Views: 1,246 Hi amarjot
Did you mean MS Excel spreadsheet, which is not a database?
If so, you may read this: http://support.microsoft.com/kb/308407/en-us/
krs,
tesu |
Forum: C++ Jun 13th, 2008 |
| Replies: 3 Views: 3,520 |
Forum: C++ Jun 12th, 2008 |
| Replies: 9 Views: 2,789 I dont care this code. Particularly it does not meet the requirements of the questioner. You may try this one:
int main(int argc, char* argv[])
{ int n=255; long double f=1.0;
for (int... |
Forum: C++ Jun 12th, 2008 |
| Replies: 9 Views: 2,789 Wrong!
long double is stored in 80 bits. So their numbers have approximately 19 digits of precision in a range from 3.37 x 10-4932 to 1.18 x 10+4932 !
The poor problem is that neither printf... |
Forum: C++ Jun 8th, 2008 |
| Replies: 6 Views: 3,821 Hi all,
though Ancient Dragon has already answered almost every question, I would like to put in my twopenn'orth too.
-Why use the stack of the space is so limited?
Stack is not that... |
Forum: C++ Jun 6th, 2008 |
| Replies: 25 Views: 5,555 Yea! Usually one needs a couple of lines, for examples:
long int reversi(long int z)
{ long int r = 0;
while (z != 0) { r = r * 10 + z % 10; z /= 10; }
return r;
}
...
cout << reversi... |
Forum: C++ Jun 3rd, 2008 |
| Replies: 5 Views: 26,277 Hi Matthew,
below is a piece of code showing a pseudo random generator based on the linear congruential method by Lehmer to generating uniformly distributed random numbers over 0 ... s - 1. Random... |
Forum: C++ Jun 2nd, 2008 |
| Replies: 6 Views: 1,300 Hi kaos,
there isn't a primal emptiness, space on the internet! So ever tried typing in "unique random numbers" at google? Guess how many entries you would have found then. Exactly, about... |