Forum: C++ Jan 26th, 2009 |
| Replies: 13 Views: 978 |
Forum: C++ Jan 26th, 2009 |
| Replies: 13 Views: 978 Now, when u asked, i don't know how i know but i know if u know what i mean. |
Forum: C++ Jan 26th, 2009 |
| Replies: 13 Views: 978 Yes, it does remain. If new operator is used u need to delete explicitly. |
Forum: C++ Jan 11th, 2009 |
| Replies: 4 Views: 392 p.s. And yes, this does loop forever if functionCall() really returns 3 |
Forum: C++ Jan 11th, 2009 |
| Replies: 4 Views: 392 no way, variable is set to true, because functionCall()!=0 is true. in this case true means 1 |
Forum: C++ Jan 2nd, 2009 |
| Replies: 16 Views: 2,445 fstream header will do. just include <ifstream>
then do
ifstream vname("filename");
vname >> array[i]; as many times as needed |
Forum: C++ Jan 2nd, 2009 |
| Replies: 12 Views: 1,270 or In #5 in the code you can change line 14 from if(str[i] < str[j]) to if(toupper(str[i]) < toupper(str[j])). |
Forum: C++ Jan 1st, 2009 |
| Replies: 12 Views: 1,270 Well, i just transformed your own code. Used string str instead of char* a[100] and char tmp instead of char* tmp[100] (u need just one character to bubble-sort, not an array).
You would like to use... |
Forum: C++ Jan 1st, 2009 |
| Replies: 12 Views: 1,270 Introducing bubble sort :)
#include <iostream>
#include <string>
int main()
{
std::string str;
std::cin >> str; |
Forum: C++ Jan 1st, 2009 |
| Replies: 12 Views: 1,270 Look, you have that #include<string.h> right? So why don't you use c++ strings? It's like
string str;
str = "whatever"
and it's easier.
Now this
for(int b=0;b<=(strlen(a)-1);b++)
{
... |
Forum: C++ Dec 30th, 2008 |
| Replies: 9 Views: 553 new allocates dynamic memory (did i choose the right words?). |