139 Posted Topics

Member Avatar for NathanMc

65 - (61 + 0) = 4 66 - (61 + 2) = 3 67 - (61 + 4) = 2 68 - (61 + 6) = 1

Member Avatar for NathanMc
0
313
Member Avatar for parrishnewbie

Hi, Put your code in code tags, it helps when reading. The answer is staring you in the face. [code] fullWord = oneWord + ", " + twoWord + ", " + threeWord + ", " + fourWord + ", " + fiveWord; [/code] Change the order of that to …

Member Avatar for Fbody
0
101
Member Avatar for |hex

Are you attempting to do this from a command line or running the program and then picking apart the input from there? Running from a command line is easy. Picking a string apart inputed after the program is ran is also easy, but a bit more involved I think.

Member Avatar for |hex
0
366
Member Avatar for neoraghav

[code] ifstream in; // Create an input file stream. in.open("data.txt"); [/code] that will open data.txt as read only. If you want to protect the file from being written over, I suggest you modify the properties of the file, or (if using windows) go to a command prompt, go to the …

Member Avatar for neoraghav
0
2K
Member Avatar for Exile_082

You need to include the switch statement in your do while loop otherwise, you will never exit the do while loop. Also, with your switch statement, everything in your default will never run. [code] //None of this code will ever run. If you enter a number to break your do …

Member Avatar for Fbody
0
187
Member Avatar for chun0216

Going through how to optimize code would take months to explain. Linear code is linear code. Both statements take x amount of time. Avoid many nested loops. If you have code, it would be easier to explain where your coding might be inefficient. Edit: If you just want to know …

Member Avatar for kes166
0
108
Member Avatar for effizy

You have a logical error in your sort. In your main, you leave name[0] unused but in your second for loop, you don't take that into account on your variable num. [code] void sortnames(string name[], int num){ int i,a, min; string strName; for (i = 1; i <= num; i++) …

Member Avatar for effizy
0
124
Member Avatar for kes166

Hi there! My name is Ken, and I'm an old (not age) C++ programmer. I went to school for it, and it's been about 7 years since I've actually programmed anything hard, so I figured a forum would be a great place to relearn alot of it by teaching what …

Member Avatar for niraj_sharma
0
153
Member Avatar for bmos31

Edited because I was wrong: You can call someFunction by s1.someFunction(s2) and have it return whichever value you want, but you will still need to make it a void function if you want both values returned. It would be easier to make a seperate function to access s1's b vaule. …

Member Avatar for bmos31
0
165
Member Avatar for StacyAnn1296

Create a structure to hold all the information and a linked list to contain the structures of each individual. You may need to create 5 special functions in the class that returns the number of people under 20 (1), 20-29 (2), 30-39 (3), 40-49 (4), 50 and older (5). Step …

Member Avatar for kes166
0
319
Member Avatar for Shredlegend

A few things here .... First, wrap your code in code tags. It makes it easier to read. Secondly, what kind of error are you getting? Thirdly, I noticed that your while loop runs until temp != Null but two lines down from that you try to reference temp->next->word. If …

Member Avatar for kes166
0
101
Member Avatar for hsquared

[QUOTE=Fbody;1331701]Your intent is a little confusing, it sounds like you want to add multiple items to the same element of an array. Which is not directly possible. [/QUOTE] Actually, I think if you create a structure, and then create an array of that structure, you can do what the op …

Member Avatar for Fbody
0
138
Member Avatar for haggard433

If [code] cout << songname << endl; [/code] works as intended and prints the song names on each individual line, then the send function is missing the endl. Is send in a library or a function you created? I'm not familiar with it if it's from a library.

Member Avatar for haggard433
0
124
Member Avatar for JDean89

The value is returned to the location where the function call came from [code] total(num1,num2); [/code] However, you didn't assign it to a variable. The return statement returns the value sum to the function call. You can do it two ways, either set the returned value to a variable declared …

Member Avatar for JDean89
0
126
Member Avatar for Frederick2

Alt + F3? [url]http://msdn.microsoft.com/en-us/library/0zz35x06(VS.80).aspx[/url] Or maybe Ctrl+K, Ctrl+L? [url]http://www.codeproject.com/KB/tips/VSnetIDETipsAndTricks.aspx[/url] That's all I could find.

Member Avatar for Frederick2
0
198
Member Avatar for super-duper

Can't you just get rid of all the if statements, and use [code] cin >> sp[index - 1].name >> endl; //etc ... [/code] And then the same concept for the viewSpeaker?

Member Avatar for Fbody
0
411
Member Avatar for hurbano

Ok, I'm a bit out of practice, so if I'm incorrect in my information, it would be helpful if someone corrected me here. It looks like you need to add a new node onto the linked list with the student name, the university, and the id. That is what you …

Member Avatar for hurbano
0
145
Member Avatar for lilfish08

[QUOTE=lilfish08;1304204]I am fairly new to c++ and have been working on this problem and asked the professor for help, but he has really been non-compliant. I am lost on this and keep gettin error messages that I do not understand how to fix. Any help that could be given would …

Member Avatar for lilfish08
0
207
Member Avatar for miskeen

[QUOTE=miskeen;1304154]Guys, I got an error with the following code: [CODE] struct myStruct { int myVar1; }; class A { //definition of A ... }; [/CODE] [CODE] struct myStruct { int myVar1; }; class B { //definition of B ... }; [/CODE] [CODE] struct myStruct { int myVar1; }; class C …

Member Avatar for harris21
0
10K