What the fuck are you talking about? When the program ends, nothing remains.
huh?
What the fuck are you talking about? When the program ends, nothing remains.
huh?
Now, when u asked, i don't know how i know but i know if u know what i mean.
Yes, it does remain. If new operator is used u need to delete explicitly.
i consider this thread lame but funny...
p.s. dev c++ must die!
p.p.s. seriously, must die already.
read the code-posting-rules first
u don't need them classrooms to learn anything, tis bullshit
Man, u gon pay money to ppl for doin ya homework or what?
p.s. And yes, this does loop forever if functionCall() really returns 3
variable would be successfully set to functionCall()'s return value
no way, variable is set to true, because functionCall()!=0 is true. in this case true means 1
Is this a joke?
Lines 11,12. n is 0 after them and also i don't get why u use for not while and why u need that int i
fstream header will do. just include <ifstream>
then do
ifstream vname("filename");
vname >> array; as many times as needed
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]))
.
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 strings in c++ instead of char arrays in cases like this, because it's much easier to do so. Like you can write string1 = string2 instead of strcpy.
that's all
Introducing bubble sort :)
#include <iostream>
#include <string>
int main()
{
std::string str;
std::cin >> str;
char tmp;
int i,j;
for(i=0;i<str.size()-1;++i) {
for(j = i+1;j<str.size();++j) {
if(str[i] < str[j])
{
tmp = str[i];
str[i] = str[j];
str[j] = tmp;
}
}
}
std::cout << str;
return 0;
}
This works.
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++)
{
for(int c=0;c<=(strlen(a)-2);c++)
{
if(strcmp(a[c],a[c+1])<0) //I DON"T THINK THIS IS RIGHT
{
strcpy(temp,a[c]);
strcpy(a[c],a[c+1]);
strcpy(a[c],temp);
}
}
}
is a mess. You could just compare a[c] < a[c+1] cuz this are characters, not strings and they are already sorted in ASCII.
Could you please explain what the program is supposed to do?
Guess it would be good to mention that an abstract class is mostly an interface, a common interface for all derevied ones. For example you can make an abstract class with only one pure virtual overloaded operator= and derive from it all "assignable" classes.
new allocates dynamic memory (did i choose the right words?).