Forum: C++ May 28th, 2008 |
| Replies: 2 Views: 498 Thank you vernon dozier for your great suggestion.... |
Forum: C++ May 27th, 2008 |
| Replies: 2 Views: 498 Dear all,
I have this code and this data...but i want to sort the sum1 in descending order..but my problem is..i want to sort many array....like this..
after sort
3: ............. 46
1:... |
Forum: C++ May 15th, 2008 |
| Replies: 1 Views: 330 I have x and y array...After I have sort y, it succefully sort the y. but for x, there is some number that are not sort like this
x y30 1
45 1
46 1
15 1
I want the x sorting also...like... |
Forum: C++ May 12th, 2008 |
| Replies: 9 Views: 976 Ok. I have suucessful read the text file...but still have some error to do a selection sort and print elements,...can somebody help me? inline 55 and 56
F:\300408\913.cpp(55) : error C2664:... |
Forum: C++ May 12th, 2008 |
| Replies: 9 Views: 976 So, What i suppose to do now?delete arr? |
Forum: C++ May 12th, 2008 |
| Replies: 9 Views: 976 I have done likethis , but cannot run the program, because there is some error.How to subscript require array or pointer? in line 43.
3.cpp
F:\300408\913.cpp(43) : error C2109: subscript requires... |
Forum: C++ May 12th, 2008 |
| Replies: 9 Views: 976 this is the sample program of selection sort, which is given the value. But, how to call the value from read file? anybody knows?
#include <iostream>
using namespace std;
void... |
Forum: C++ May 6th, 2008 |
| Replies: 10 Views: 809 i have change like this, but the output only display for i=0 only.
and it said in is using without initialized.
in is for what actually? cin?
output
1 20
1 20
Press any key to continue |
Forum: C++ May 6th, 2008 |
| Replies: 10 Views: 809 fill it from the data that is read mean if I have 3 data so must write..and if i have 100 data, so i must write also..is it like that? |
Forum: C++ May 6th, 2008 |
| Replies: 10 Views: 809 but, i want to call the data from the text file...because, i have 100-300 data, So it it another way, to do? |
Forum: C++ May 6th, 2008 |
| Replies: 10 Views: 809 Dear Ancient Dragon,
so, I must declare like this?
void main ()
{
int y[]={20,30,25};
int x ; |
Forum: C++ May 6th, 2008 |
| Replies: 10 Views: 809 how to called the selection sort?what must i add? |
Forum: C++ May 5th, 2008 |
| Replies: 10 Views: 809 Why the selection sort output not appear? Anybody knows how to correct it?
#include < iostream >
#include < string >
#include < cmath >
#include < iomanip >
#include < fstream > |
Forum: C++ May 5th, 2008 |
| Replies: 12 Views: 1,778 so I must write like this?add the selectionsort in line 48?
#include <iostream>
#include <string>
#include <cmath>
#include <iomanip>
#include <fstream>
using namespace std; |
Forum: C++ May 5th, 2008 |
| Replies: 0 Views: 338 why the output do not produce the output after sorting....anybody knows how to do a selection sort code?
#include <iostream>
#include <string>
#include <cmath>
#include <iomanip>... |
Forum: C++ May 5th, 2008 |
| Replies: 12 Views: 1,778 why the output only produce
1 20
2 35
3 15
but not produce for the selection sort output?
#include <iostream>
#include <fstream> |
Forum: C++ May 5th, 2008 |
| Replies: 12 Views: 1,778 i change the a[i] to x and total[i] to y[i] ..so it easy to read..
the x and y are the data from a read file
jes.txt
1 20
2 30
3 25 |
Forum: C++ May 5th, 2008 |
| Replies: 12 Views: 1,778 i have done a correction, but the programming said..x and y are used without initialized..inline 50
How to initialized x and y?
F:\300408\905.cpp(51) : warning C4700: local variable 'y' used... |
Forum: C++ May 4th, 2008 |
| Replies: 12 Views: 1,778 how to make correction of this error in line 41 and 63
.5.08.cpp
f:\300408\3.5.08.cpp(41) : error C2601: 'selectionSort' : local function definitions are illegal
f:\300408\3.5.08.cpp(63) :... |
Forum: C++ Apr 30th, 2008 |
| Replies: 12 Views: 1,778 After read this file , i want to do a selection sort...below are the selection sort programming that i get from google
#include <fstream>
#include <string>
#include <iomanip>
#include... |
Forum: C++ Apr 30th, 2008 |
| Replies: 9 Views: 568 -858993460
is the output file,,,,thank you Master Vernon |
Forum: C++ Apr 30th, 2008 |
| Replies: 9 Views: 568 for (i = 0; i < 3; i++)
yehaaaaaaaaaaa...i get that it..after i change from 4 to 3 then the -858993460
dont appear...... |
Forum: C++ Apr 30th, 2008 |
| Replies: 9 Views: 568 This is a data that I wnt try to read..but why when i compile it appear -858993460
after 50?why..i dont know what is -858993460
1 20
2 15
3 50
#include <fstream> |
Forum: C++ Apr 30th, 2008 |
| Replies: 9 Views: 568 I try to read this file firt , but it have -858993460 in the last?
1 20
2 15
3 50
-858993460
Press any key to continue
#include <fstream>
#include <string> |
Forum: C++ Apr 29th, 2008 |
| Replies: 9 Views: 568 but I want to do a selection sort because it more quickly than bubble sort |
Forum: C++ Apr 29th, 2008 |
| Replies: 9 Views: 568 I have this data, but when i sort it different from what i want.
I want to sort in descending order like this
2 30
1 20
3 15
jest.txt
1 20 |
Forum: C++ Apr 28th, 2008 |
| Replies: 2 Views: 656 How to do a selection sort?
Which I want to sort in descending order this data
1 50
2 90
3 40 |
Forum: C++ Apr 28th, 2008 |
| Replies: 14 Views: 872 so..I must continue this programming or continue the old one? |
Forum: C++ Apr 28th, 2008 |
| Replies: 14 Views: 872 So I must chane [i][0] to [140][2]?
int array[140][2] = {0};
ifstream myfile("STA83SOLUTION.txt");
int i;
while( myfile >> array[i][0] >> array[i][1] )
i++; |
Forum: C++ Apr 28th, 2008 |
| Replies: 14 Views: 872 F:\508.cpp(35) : warning C4508: 'main' : function should return a value; 'void' return type assumed |
Forum: C++ Apr 28th, 2008 |
| Replies: 14 Views: 872 Why no output is appear?
#include <iostream> // std::cout
#include <fstream>
#include <iomanip>
#include <string> // std::string
#include <vector> // std::vector<>
#include... |
Forum: C++ Apr 28th, 2008 |
| Replies: 14 Views: 872 Just change it like this to make 2d array?
int array[140][2]={0};
int temp;
if (myfile.is_open())
{
for (int i = 0; i < exams.size(); i++)
{
for (int j = 0; j<exams.at(i).total.size();... |
Forum: C++ Apr 27th, 2008 |
| Replies: 14 Views: 872 I'm having problem when i want to cout the data that i sort.
int temp,bubsort,arr,display;
if (myfile.is_open())
{
for (int i = 0; i < exams.size(); i++)
{
for (int j = 0;... |
Forum: C++ Apr 27th, 2008 |
| Replies: 14 Views: 872 yes...but it was so complicated..i want to read as simple as possible. |
Forum: C++ Apr 27th, 2008 |
| Replies: 14 Views: 872 How to declare the array and read the array? Must I use data structure?
Two array
1 30
2 20
3 10
4 50
5 15 |
Forum: C++ Apr 23rd, 2008 |
| Replies: 8 Views: 1,285 I have done like this.. but still many error..
i have change ti float..then for array.total i change to size.total=0.
rror C2228: left of '.push_back' must have class/struct/union type... |
Forum: C++ Apr 22nd, 2008 |
| Replies: 8 Views: 1,285 "
Ancient,..
where is teh curernt value of total? |
Forum: C++ Apr 22nd, 2008 |
| Replies: 8 Views: 1,285 yes...I want to do like that but
" instead of push_back(123) just add 123 to the current value of total. "
123 ?I dont understand...Ancient Dragon. |
Forum: C++ Apr 21st, 2008 |
| Replies: 8 Views: 1,285 How to change this data sturucture from vector <int> total; to float total;? because if I change it to float teher is many error....
#include <iostream> // std::cout
#include <fstream>... |
Forum: C++ Apr 18th, 2008 |
| Replies: 11 Views: 996 thank you so much chandra rajat and localp...I will try try to do your suggestions. |