15,300 Posted Topics

Member Avatar for sarahger9

You need to pass those vectors by reference instead of by value to avoid duplicating the vectors and so that the changes will be available to the calling function [icode]vector<int> merge(vector<int>[color=red]&[/color] list1, vector<int>[color=red]&[/color] list2){[/icode]

Member Avatar for Ancient Dragon
0
105
Member Avatar for Ccrobinson001
Member Avatar for Nidaa87

It might help to explain your problem is you show something that illustrates what you want to do, because I have no clue what you want.

Member Avatar for Salem
0
99
Member Avatar for iCare

line 12: never ever use [b]gets()[/b] because it can destroy your program. Use [b]fgets()[/b] instead. line 15: you don't need an array of temp pointers. Just one temp pointer will do. I've always coded the bubble sort like this: Note that the inner loop begins one slot beyond the current …

Member Avatar for Narue
0
173
Member Avatar for swuwarrior

>>if (memory[i].substr(0,4)=="0000") memory is an array of integers which of course don't have methods. [edit]^^^ what Shawn said[/edit]

Member Avatar for ShawnCplus
0
123
Member Avatar for kv79

>>My question is ,is it really addres or i am wrong informed and if it addres how to use in Dev-C++?is it possible? Yes, as far as I know, those are the actual memory address. You can not access them directly with any 32-bit compiler unless you write your own …

Member Avatar for Salem
0
162
Member Avatar for sathishkumar.e

>>ofstream* rgpostrm [BASE_LAYER]; Why do you need to many streams? And why allocate them ? >>What it says for ios::binary | ios:out and ios:out | ios::binary There is no difference between the two. Its like asking what's the difference between 2 times 3 and 3 times 2.

Member Avatar for Ancient Dragon
0
115
Member Avatar for art vandelay

why don't you make it easy on yourself and give each one a name like you did [b]Emp1[/b] == use [b]Emp2[/b], [b]Emp3[/b], etc. Then I think you can create a jump table [code] table dw Emp1, Emp2, Emp3 [/code]

Member Avatar for Tight_Coder_Ex
0
147
Member Avatar for lrnzsmok1

>>Can anyone get me started with this?? Yes [code] int main() { // your code goes here } [/code] How much do you know about the assignment you were given ? Everything that's in your assignment should be covered somewhere in your textbook.

Member Avatar for Ancient Dragon
0
123
Member Avatar for dsuh06

(1) The language specification requires them. (2) they separate initialization, condition, and increment statements.

Member Avatar for Ancient Dragon
0
108
Member Avatar for cl3m0ns

That while statement on line 13 is incorrect because eof() doesn't work like that. Instead, code it something like this [code] string line; while(getline(infile, line) ) { // now split this string into individual parts for the structure } [/code]

Member Avatar for WaltP
0
160
Member Avatar for onelilfizzle
Member Avatar for cl3m0ns

Well yes its possible, but why would you want to do it? Unless, of course you are passing a pointer to another function. [code] Employee emp; Employee* ptr = &emp; ptr->display(); [/code]

Member Avatar for WaltP
0
99
Member Avatar for dukedoc

The function is doing a case-sensitive search -- maybe the search string is not the same case as the strings in the array. You might to a case insensitive compare by converting both strings to all upper case (or lower case) before performing the comparison. Otherwise I see no reason …

Member Avatar for Ancient Dragon
0
94
Member Avatar for caylyn

>>plsss....anyone help me........ If you would read your text book you could help yourself.

Member Avatar for ithelp
0
105
Member Avatar for pupu14

Did you make any attempts at all to do your own research, like read some of [URL="http://www.google.com/search?hl=en&q=cpu+scheduling+algorithm&btnG=Google+Search"]these[/URL] google links? Or google for the algorithms you want, such as [URL="http://www.google.com/search?hl=en&q=FCFS&btnG=Google+Search"]these links[/URL]?

Member Avatar for ithelp
-1
89
Member Avatar for everyday

>>is there a way to know what it is expecting you to type? Not unless you have found some kind of mind reading program or a crystle ball :) There are no functions that can anticipate what you are to type. You will have to type the answer and press …

Member Avatar for Ancient Dragon
0
88
Member Avatar for alleli

Look on the games board, there are lots of them. tick-tack-toe and hangman are two common ones to write.

Member Avatar for WaltP
0
92
Member Avatar for sonsofliberty84

You may not have to do anything with that file other than rename it with csv extension. If paraview is like Excell then you can specifiy column deliminator, and in your case it is a space. If paraview can not do that, then your program should be fairly simple [code] …

Member Avatar for Ancient Dragon
0
301
Member Avatar for sneekula

Miracle on 34th Street (the original version, not the updated piece of trash).

Member Avatar for vegaseat
0
166
Member Avatar for gchasproblem

1. move line 12 up outside the do loop, between lines 8 and 9. Once the string is converted to upper case there is no point in repeating that process. You need to reformat the code to make it easier for us to read and understand. It's great that you …

Member Avatar for Ancient Dragon
0
113
Member Avatar for toko

you could use an array of structures [code] struct phrases { char* correct; char* response; }; phrases ph[] = { {"CU","See You\n"}, {":-)", "I'm happy\n"}, // etc }; cout << "Enter phrase>"; cin >> input; for(int i = 0; i < sizeof(ph)/sizeof(ph[0]); ++i) { if(stramp(input, ph[i].correct) == 0) { cout …

Member Avatar for toko
0
93
Member Avatar for balla4eva33

>>and any other pointers with how I should code the else porition on my operator + The easiest way is to use the [b]mktime[/b] function in time.h. Populate a [b]struct tm[/b] structure with the year, month, and day + days_to_increment, then call mktime() to normalize the data. Upon return the …

Member Avatar for balla4eva33
0
120
Member Avatar for tones1986

1. you can not initialize c-style character arrays like you are trying to do in the class constructor. My suggestion is to declare them as c++ string objects. If you can not do that then to initialize the arrays to empty string just set the first byte to 0, like …

Member Avatar for tones1986
0
122
Member Avatar for legendarya49

>>the program gives me an infinite loop where ? If you don't know where then add some print statements or use your compiler's debugger. And your bubble sort algorithm is wrong because it goes through too may iterations and comparisons. [code] void sortScores( int x[], int size ) { for( …

Member Avatar for legendarya49
0
146
Member Avatar for MidiMagic
Member Avatar for Ancient Dragon
0
133
Member Avatar for kv79

[URL="http://www.winprog.org/tutorial/"]Here[/URL] is an introductory tutorial -- and you can keep your [b]free[/b] book

Member Avatar for kv79
0
126
Member Avatar for jadedreality

>>Is there any way to easily change what I have, to what I am supposed to have? Depends on your definition of [b]easily[/b] :) It will require some rewriting of each of those cout lines, but shouldn't been too difficult. Something like below (not compiled or tested) [code] #define PRINT_DOT …

Member Avatar for vmanes
0
137
Member Avatar for deraj8

[b]TemporaryBalance[/b] needs to be declared as either type float or double because integers do not contain decimal values. line 22: syntax error -- here is correction: [icode]int linearSearch(const int array[],int size, int findnumber)[/icode] lines 11-16: If the account is not already in the array then you have to add one. …

Member Avatar for Ancient Dragon
0
121
Member Avatar for toko

try this: It does a case-sensitive comparison, such as "Rudolf" is not the same as "rudolf" [code]#include <iostream> using namespace std; int main() { char input[20]; char correct [] = "Rudolf"; cin >> input; if (strcmp(input, correct) == 0) { cout << " correct"; } else { cout << "incorrect"; …

Member Avatar for toko
0
220
Member Avatar for jadedreality

You didn't post the [b]include[/b] file(s) -- you DID include the headers for AnsiString didn't you ????? line 3: remove the semicolon between AnsiString and Line. line 6: you have to declare all functions before they can be used. If the function is not coded before the function in which …

Member Avatar for Ancient Dragon
0
238
Member Avatar for Oreynid

Commenting code is very good -- but commenting with wrong information is very very bad. >> // Clears the unused characters from the buffer that function does not do what you said it does. [URL="http://www.cplusplus.com/reference/iostream/ios/clear.html"]The [b]clear[/b] method clears error bits.[/URL] >> Ignores the buffer generated by cin.clear Doesn't do that …

Member Avatar for Salem
0
10K
Member Avatar for ENG ISE student

Is using '#' to deliniate lines required by the assignment or is it something you dreamed up on your own? [code] while( cin >> name >> street >> city >> state >> zip) { } [/code]

Member Avatar for ENG ISE student
0
97
Member Avatar for vincex200

>>That code is probably riddled with bugs Yes it is. >>and I'm still half a sleep you should have went to sleep instead of posting that code. Attempting to program while half asleep is not good -- been there and done that (unsuccessfully I might add). [code] const int ARRAYSIZE …

Member Avatar for Ancient Dragon
0
101
Member Avatar for quickster12

Glad to see [URL="http://www.programmingforums.org/thread14645.html"]you are posting this question[/URL] everywhere you can :)

Member Avatar for vmanes
0
92
Member Avatar for use4d

[QUOTE=MidiMagic;436176]The sex laws of the Old Testament were designed to prevent STDs. If everyone had been obeying them, there would never have BEEN an AIDS epidemic.[/QUOTE] That might be true only if everyone in the whold wide world new about those sex laws. Since AIDS began in Africa its highly …

Member Avatar for jasimp
0
436
Member Avatar for sathishkumar.e

I don't think there is a general way to do it. A char data type is not large enough to use the method that Salem posted. And my compiler VC++ 2005 Express doesn't allow this either even when I typcast the pointers to unsigned long. [code] int main(int argc, char* …

Member Avatar for Duoas
0
134
Member Avatar for ariswin

in america a [b]democrat[/b] is a political party, not a type of government. And No, the USA is not a democracy but is a republic. There are no true democracies anywhere in the world. A [b]republican[/b] is also a political party. The terms [b]liberal[/b] and [b]conservative[/b] are also used to …

Member Avatar for Jicky
-2
292
Member Avatar for Ancient Dragon

Came across [URL="http://www.jokes2go.com/lists/list14.html"]this[/URL] when researching the answer to another question on c++ board and had to share. Just a couple of them below [quote] May all your teeth fall out except for the one with the toothache! May your daughter's hair grow thick and abundant, all over her face! May …

Member Avatar for karoke
0
78
Member Avatar for Sturm

We stole it from UK. The early white settlers brought that tridition with them and we just adopted it as a national holiday.

Member Avatar for rectifier
0
488
Member Avatar for rajeev_028
Member Avatar for SNN

>>I open the data file 26 times Why ??? Your program is failing to close the file before opening it again. >>I need to traspose the data What do you mean by that? to make columns rows and rows columns ?

Member Avatar for Ancient Dragon
0
121
Member Avatar for cameron.kay

what do you think the answer is? If you have 30 apples and I give you 20 more then how many apples will you have? The answer is that simple.

Member Avatar for WaltP
0
102
Member Avatar for driplet

>>CHARACTER ST1*10 probably [icode]char st1[10];[/icode] >>CHARACTER ST*(*) My guess is [icode]char *st;[/icode]

Member Avatar for WaltP
0
190
Member Avatar for johnnyjohn20

>>Would anybody know a way to repeat a program use a loop [code] while( not done ) { // display menu // get input // if 'Q' entered then exit the loop // do something } [/code] Not sure what you are trying to do that that code you posted. …

Member Avatar for WaltP
0
273
Member Avatar for BlackNinja

after line 86 you need to actually read a line from the file -- you can't just simply ignore it. [code] string line; for(i = 0; i < 6; ++i) { getline(infile,line); if( i > 1) { // convert to number, you can use stringstream class to do that. } …

Member Avatar for BlackNinja
0
135
Member Avatar for helpneeded

what have you tried? The logical query would be [icode]where a = condition1 and b = condition2 and e <= something[/icode] but since we don't know what condition1 and condition2 are we can't give much more help. So post your actual code if you want better help.

Member Avatar for pty
0
334
Member Avatar for cgraves

Hope this helps. >>repetition [code] int main() { while(true) // start of loop { // repeat code goes here } // end of loop } [/code] >>no user defined functions Just a function you write yourself. Call it anything you wish except [b]main[/b] [code] int userDefinedFunction() { cout << "This …

Member Avatar for WaltP
0
112
Member Avatar for HLA91

line 13 -- you forgot the semicolon at the end. line 15: need to escape the '' character [icode]djout.open("C:\\TEST.txt");[/icode] I'm not going to tell you the rest of the errors. Just fix them one at a time and compile after each correction.

Member Avatar for Ancient Dragon
0
115
Member Avatar for shers

The End.