sry 4 nt clearify.....actually i want to print the string which have more then 1 count value...but here even i cant compile my code,,its giving some error like
"48 33 C:\Users\elkana\Documents\vector.cpp [Error] cannot pass objects of non-trivially-copyable type 'class std::vector<std::basic_string<char> >' through '...'""
i.e. the problem is i passing or accepting the vector as argument....
in this case when j == 0 A is substituted to 2. When j == 1 temp[j] == '-'. You decrease j. So j again will be equal to 0. In loop the j increased and becomes equal to 1. Again temp[1] == '-'. As the result you get an infinit loop.
HEY NOW I HAVE EDIT THE ABOVE CODE BUT ITS THE SAME PROBLEM...EARLIER I ASSUME THE I/P NOT TO PUT "-".....THE PROBLEM IS IN
PRINTF ("%S%d",STR[i],COUNT);
THE MAIN PROB..IS IN STR[i].....
Make sure you're using the Orwell Dev-C++, as the original Dev-C++ is extremely outdated and behind the times in C++ support. There's an article about it: http://www.cplusplus.com/articles/36vU7k9E/
Did you also change str[i] to (*str)[i] on line 45 with the printf?
Also, printf/scanf are from C, and cout/cin are from C++. You cant mix these n your programs like this, pick either the C or the C++ and stick with it.
You cannot mix cin/cout with scanf/printf - they operate on different wavelengths. You can use 100% scanf/printf or 100% cin/cout, but you can not mix them together. They both operate on your program's input and output streams, but they operate in different ways that conflict with each other.
I'm having a hard time thinking of an analogy so I hope you understand it just can't be done.