Posts
 
Reputation
Joined
Last Seen
Ranked #471
Strength to Increase Rep
+6
Strength to Decrease Rep
-1
92% Quality Score
Upvotes Received
11
Posts with Upvotes
10
Upvoting Members
8
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
6 Commented Posts
~17.1K People Reached
Favorite Tags
Member Avatar for Chris-16

You just want to know how to print a table? I did it using three for loops, kinda like this: [CODE] cout<<"\n"; for(int x=0 ; x<=3; x++){//prints rows of 4 incremented rates cout<<"\trate"; //print one row, then increment the rate }//end for cout<<endl; for(int y = 1; y<=12; y++){//makes 12 …

Member Avatar for andigirlsc
0
347
Member Avatar for ellisrn

[QUOTE=WaltP;1159755]here we do not not give programs to people,[/QUOTE] Ah, so you [I]do [/I]give programs to people? //just kidding...double negative there, lol

Member Avatar for Fbody
0
1K
Member Avatar for -ordi-

Correct me if I am wrong, but it looks to me like what you would like to do is something like this. The inputs are labeled A, B, C, D, and E, respectively. So your first input is the rank of where A is, out of the total amount. So …

Member Avatar for -ordi-
0
139
Member Avatar for MyrtleTurtle

Is it the boost library? Regex in particular? I have searched and searched, but this is all I could come up with. If this is the correct library, then how do I get it to work in Dev-C++? I managed to add all the boost .h files to my Dev-C++ …

Member Avatar for mike_2000_17
0
365
Member Avatar for madoverclocker
Member Avatar for superchica08

The error I get is 'address of while(AreThereMore) will always evaluate to true.' You need the ()'s when calling the function. Also I see a couple of things in your AreThereMore() function: If answer is not true, you need to set it to false. And when you compare you need …

Member Avatar for jwenting
0
1K
Member Avatar for Fenlevi

It seems to work fine for me, too, though it took me a minute to figure out what the program does. The first number input is the size, right? So if you input 4,3,2,1,0 it will say that the size is 4 and the elements are {3} 2} 1} 0} …

Member Avatar for MyrtleTurtle
0
139
Member Avatar for jgehlot09

My compiler would not let me use sleep (with a small 's'). And...I always use larger numbers. I don't think your delay is very long. If you want a half-second delay: [CODE]Sleep(500);[/CODE] You don't need the tab, if you want the stick to show up in the same spot each …

Member Avatar for MyrtleTurtle
0
119
Member Avatar for doom5

i++; j--; If j==5 and i==0 and we increment i at the same time as we decrement j... after the 1st iteration: i = 1 j = 4 2nd iteration: i = 2 j = 3 3rd iteration: i = 3 j = 2 And your loop doesn't stop until …

Member Avatar for girishn
1
140
Member Avatar for Jaxzen

EOF means end of file. You can check for it like this: [CODE]while(!infile.eof())[/CODE] It looks to me like you have closed your file and then tried to read from it. [CODE]infile.close(); //Force closes the file while (infile) { if([/CODE]

Member Avatar for Lerner
0
928
Member Avatar for kut KK

I would use [iCODE]string grade;[/iCODE] instead of [iCODE]char grade;[/iCODE], so that you can have the - or + with it. A char represents [I]one [/I]character. Also, why don't you use [iCODE]int main() [/iCODE]instead of [iCODE]void main()[/iCODE] ? And you probably want [iCODE] #include<iostream>[/iCODE] instead of [iCODE]#include<iostream.h>[/iCODE].

Member Avatar for MyrtleTurtle
0
229
Member Avatar for MyrtleTurtle

My assignment this week deals with using a struct. I think I can do that part. What I'm having trouble with is reading the file into each variable. The first item in the file is text with spaces. The next items are numeric and need to go into other variables, …

Member Avatar for MyrtleTurtle
0
122
Member Avatar for Violet_82

It is because each line executes in order. The order you have here is to check if f == 5 first, and if so then cout<< your message. If f!=5 though, it will check to see if f==5 once, then go into the loop. There is no code to take …

Member Avatar for Violet_82
0
134
Member Avatar for gorgey506

Well, just look where you put the brackets and what is inside them. What does [iCODE]return 0;[/iCODE] do? Do you want that inside your while loop? Also, I noticed before, in your other question, that these brackets don't seem to belong here. And if it was me, I wouldn't indent …

Member Avatar for gorgey506
0
177
Member Avatar for MyrtleTurtle

I've seen posts here that were posted in the wrong forum. Today there was one in the IT professionals forum that should be posted under HTML instead, and one with C code in the C++ forum. What do you think about creating a forum for members to report posts? Besides …

Member Avatar for jbennet
0
232
Member Avatar for PinoyDev

Here is one way of reading from a text file and displaying the contents: [CODE] string sentence; string readSentence; //open file to read ifstream inData; inData.open("YourFileName.txt"); //read first line from the file getline(inData, readSentence); //show error if file not found if(!inData){ cout<< "Can't open input file.\n"; getchar(); } //while there …

Member Avatar for PinoyDev
0
130
Member Avatar for gorgey506

Not trying to butt in here, but I'd say that the error is on (or at least caused by) a line above the underlined one. A while loop should include brackets like: [CODE]while(condition){//bracket goes here //do stuff }//end loop[/CODE]

Member Avatar for gorgey506
0
161
Member Avatar for kmaxat
Member Avatar for rtllz

You're trying to calculate before you get the input. This line should go after you get the input to assign a value to price and quantity. [CODE]total = price * quantity * tax;[/CODE]

Member Avatar for rtllz
0
144
Member Avatar for skorm909

some people use [CODE]system("cls");[/CODE] [URL="http://www.daniweb.com/code/snippet216428.html"]Here's[/URL] one example.

Member Avatar for WaltP
0
171
Member Avatar for cowboyz209

What does the program do as opposed to what it's supposed to do? Are you getting any errors? Also you should probably use code tags: [code ]paste your code between tags like these, without spaces [/code ].

Member Avatar for WaltP
0
152
Member Avatar for Annettest

I do not know how to add new columns to a matrix either. This may not be the exact answer you are looking for, but I think it is similar to what you want to do: [CODE]//if you had a vector called nums, and a 2d array called ary, you …

Member Avatar for Lerner
0
256
Member Avatar for MonteM

I would make a more general function instead of telling it the exact number of lines. [URL="http://www.cplusplus.com/doc/tutorial/files/"]Here's[/URL] a page with an example of how to check for end of file.

Member Avatar for Fbody
0
138
Member Avatar for MTW1989

You also still have the same 2 issues I mentioned the other day, in your other thread about the 2-d arrays (with this program). While I do not think this will affect your program (because you get the value with user input later) it is still not correct. [CODE] char …

Member Avatar for MyrtleTurtle
0
261
Member Avatar for MTW1989

In addition to what Fbody said, you have an infinite loop. [CODE]char Y = 'Y'; //add 's around your char printintromessage (); getUserInput (Y); do { if (Y == 'Y' || Y == 'y') { printplayerinfo (numofgamesinseries, numofplayersonteam, i, j); //you'll have an infinite loop unless you stop it somehow …

Member Avatar for MTW1989
0
195
Member Avatar for MyrtleTurtle

This is my first question here. My latest assignment is to create a random walk program using a 2-d array. The program worked fine until I tried to put this code into a function: [CODE] for(int i = 0; i < 100; i++){ //reset field of flowers for each attempt …

Member Avatar for Fbody
0
231
Member Avatar for heynow12

Could you use a while loop? Here is an example of a while loop that runs until a condition is met: [CODE]bool x=false; int num = 0; while(!x){//while x is false //test if(num ==5){ //if pass: cout<<"true"; x = true; } else{ //if fail: cout<<num<<endl; num++; } //should exit when …

Member Avatar for phyrtech
0
166
Member Avatar for wilsonz91

Do you mean that you don't want to have to press enter after each (one character) number is entered? If so, then yes it is possible. I'm sure I have seen this done a different way, but here is one way anyhow: [CODE] char num1, num2, num3, num4, num5; cout …

Member Avatar for WaltP
0
2K
Member Avatar for fugnut

If all your function does is display (print) the name of the shape, then why return anything? I'd just call it a void function and omit the return statement. Then when you call it, don't assign it to anything: [CODE]aFunction(); //call a void function //declare function as void void aFunction(){ …

Member Avatar for fugnut
0
96
Member Avatar for timbomo

You don't even need to pass in grade or tot_quest into your functions if you are getting their values within the function. You can just define them within the function (if you don't need them anywhere else in the program.) [CODE] double calculateGrade(double grade) { int quest_corr, tot_quest; grade = …

Member Avatar for Lerner
0
140