5,676 Posted Topics

Member Avatar for swuwarrior
Member Avatar for swuwarrior

[QUOTE=Duoas;469986]I will assume by the added comment... I also am going to assume ...[/quote] I wouldn't. I've wasted my time making assumptions... :icon_wink: Since you don't want to explain what's going on, just start putting output statements in your code to see if the values are correct as the program …

Member Avatar for WaltP
0
142
Member Avatar for superrg86

[QUOTE=superrg86;470099]i don't know how to fix this error can any one help me here's my code: [code=c++] StringStack::StringStack(string value) { stackArray = new string[value]; stackVal = value; top = -1; } [/code] [/QUOTE] [I]top[/I] is undefined. [I]stackVal[/I] is undefined. No idea what line the errors are on. What can we …

Member Avatar for WaltP
0
88
Member Avatar for phasiro

[QUOTE=phasiro;469166]Hi, noob on board. I have some issues with the spliting data according to tab. What i need is to grab multiple inputs from a txt file and generate it into result txt file. the input file reads like; Johnny Bravo /tab S1234567 Systems /tab/tab DT012 VB /tab/tab DT234 Adv …

Member Avatar for phasiro
0
126
Member Avatar for jaepi

[QUOTE=jaepi;469423]Hello there, I have here a bit of confusion with fread. I have here a .cue file generated in windows. I tried to read through the entire file in windows and when I printed the buffer, it gives me the correct content of the file, but when I read it …

Member Avatar for ithelp
0
131
Member Avatar for Fabledmetal

Use an array initialized to underscores. Then for each letter guessed correctly, replace the appropriate values with the letter guessed. Then you can output this array.

Member Avatar for WaltP
0
93
Member Avatar for banditt_77

[QUOTE=banditt_77;468603]I was just looking of ideas and clues on how to do it or understand how to go about it using a while loop, I'm just trying to learn how to write simple programs this is by no means some kind of homework. I'll take the post off if you …

Member Avatar for Salem
0
162
Member Avatar for Benimaru025

[icode]char Data = char();[/icode] What is [I]char()[/I]? [I]string()[/I]? [I]int()[/I]? These lines I assume give you an error, therefore you have no idea if your [I]while[/I] is messed up. [ICODE]in >> Data[/ICODE] What are you expecting to read with this line? [ICODE]while (!in.eof())[/ICODE] Since [I].eof()[/I] is the same as [I]feof()[/I], [url=http://www.gidnetwork.com/b-58.html]read …

Member Avatar for WaltP
0
144
Member Avatar for megan-smith

One possible way to implement this is using a magic square: [code] 4|3|8 ------ 9|5|1 ------ 2|7|6 [/code] It was effective when I wrote TTT the first time.

Member Avatar for WaltP
0
175
Member Avatar for Dani

>There were a couple of style changes today so I want to mention them ... Firstly, the [inlinecode] tag has been replaced with [icode] to make it easier / quicker to type. Excellent!!!! >The watermark behind the editor indicating to use code tags (programming forums) and not to solicit or …

Member Avatar for Dani
0
162
Member Avatar for lalavoodoo15

[QUOTE=lalavoodoo15;467086]Hi, i am trying to make a program that gets words from a txt file (strings) and see if the words have the character the user has inputed before. ----------------------------------------------------------------------------- I have no clue what my next step is.[/QUOTE] Maybe look at the word entered ([I]a_word[/I]) for the letter specified …

Member Avatar for Ancient Dragon
0
106
Member Avatar for Salem

One possibility to consider is to allow BOLD and ITALIC using language-specific tags. Just a thought.

Member Avatar for Dani
0
131
Member Avatar for deadswitch

[QUOTE=deadswitch;466473]I've re-worked this code enough times that my brain is about to explode. The following is an (obviously) incomplete version of how I'm starting things off. I suspect some gross conceptual error, but I can't figure it out. At this point all I want to do is get the program …

Member Avatar for Aia
0
139
Member Avatar for Flakester

OK, let's look at this thing logically [code=cpp] int main() { long double num = 98; while ( num < 0 || num > 97 ) { cout << "Which Fibonacci Number Would You Like? "; cin >> num; } // you just read your FIBB number into **num** long …

Member Avatar for WaltP
0
119
Member Avatar for IzzoYourNizzo

[QUOTE=IzzoYourNizzo;467038][B]This is my code, and I can't figure out why its wrong.[/B] for( k = 0; k < n; k++){ avgTemp= 0; total += temps[n]; avgTemp = total/n; }[/QUOTE] [QUOTE=Duoas;467040]1. [B]n[/B] is the number of elements in the array, where [B]k[/B] is 0, 1, 2, ..., n-1. 2. There is …

Member Avatar for WaltP
0
128
Member Avatar for m16jim
Member Avatar for The Dude

[QUOTE=jacknight;366911]maybe I should update now... [url]http://img.photobucket.com/albums/v281/jacknight/Picture1-7.png[/url] you guys just can't compete.[/QUOTE] Did the bunny get hurt when you finally missed?!?? :icon_cry:

Member Avatar for 13Girl
0
261
Member Avatar for SurviBee

[QUOTE=SurviBee;465842]My compiler tells me that I cannot declare the function Primelist(float) without a type...[/QUOTE] [ICODE]main()[/ICODE] is an [I]int[/I] type. What type did you define [ICODE]Primelist(float)[/ICODE]? [QUOTE=SurviBee;465842]... and that the prototype for it does not match any in class 'Primelist'[/QUOTE] Well, how is it defined and how is it used? Are …

Member Avatar for vijayan121
0
248
Member Avatar for jadedreality

[QUOTE=jadedreality;466429]Okay, here's what I have so far: [code] #include <iostream> #include <conio.h> void main () { clrscr(); int array [3], t; for (int x=0; x<3; x++) { cout << "Enter integer number" << x+1 << " : " << endl; cin<< array[x]; } for (x=0; x<3; x++) { for (int …

Member Avatar for jadedreality
0
395
Member Avatar for mandsmom

Once we cot CODE tags in your post, you have some very nicely formatted code! I don't see where your equation has been implemented. Can you figure out where it should go?

Member Avatar for WaltP
0
230
Member Avatar for gator6688

[QUOTE=Narue;466333]>Without actually naming letter grade how will it know to save it as that? Dude, are you [I]really[/I] this helpless? When you print the letter grade to cout, print it to outFile too. I completely fail to see how that's not the most obvious solution in the world.[/QUOTE] Hmmmmm... [QUOTE=Narue;466117]... …

Member Avatar for gator6688
0
327
Member Avatar for The Dude

[QUOTE=sharky_machine;279104]It seems, a lot of people would-- they sell a lot. I wouldn't, probably; I don't really like drinking pop much-- perhaps a [I]Mountain Dew[/I] when I need a caffeine boost and my coffee limit is maxed. Coding [B]all[/B] night, ya know ;) .[/QUOTE] Not sure I understand this... What …

Member Avatar for The Dude
0
199
Member Avatar for Jacky1

[QUOTE=Narue;466045]>Which unfortunately if I understand it does not allow >you to stream the information into an array of strings I don't see that restriction anywhere. In fact, while you're prohibited from using std::string, there doesn't seem to be a restriction on std::vector, so you can greatly simplify how you handle …

Member Avatar for Narue
0
101
Member Avatar for Alethea
Member Avatar for piscean123

[QUOTE=venkata;465826]how to print /n[/QUOTE] Start your own thread. Don't hijack someone else's discussion.

Member Avatar for piscean123
0
139
Member Avatar for amin3d
Member Avatar for amin3d

Sure. Start with your input, make sure it compiles and works. Then add the next step as per the instructions. Compile and test. Keep it up until the program is done. You might want to [url=http://www.daniweb.com/techtalkforums/thread78223.html]Read This![/url]

Member Avatar for WaltP
0
87
Member Avatar for bStiffler582

See [url=http://www.gidnetwork.com/b-58.html]this info[/url]. [ICODE]feof() [/ICODE]is the same as [ICODE].eof()[/ICODE]

Member Avatar for bStiffler582
0
167
Member Avatar for abarnett

It works either way, but putting the proto in the function IMO just clutters up the function.

Member Avatar for WaltP
0
3K
Member Avatar for ITapprentice

[QUOTE=ITapprentice;463471] [code] else //c is a single quote { [COLOR="Red"]//How do I make the single quote be counted if there is an[/COLOR] [COLOR="Red"]//alphabetic character to the left and to the right of it?[/COLOR] } [/code][/QUOTE] Probably you want to set a flag that says "I have a quote". And you …

Member Avatar for Narue
0
218
Member Avatar for theteamdrunk

Is your task to input a file name, and convert the filename itself to upper case? Or are you supposed to 1) open the file 2) read the file 3) convert the [I]contents[/I] of the file to upper case? And if you don't take the hint on [INLINECODE]gets()[/INLINECODE], we may …

Member Avatar for Aia
0
210
Member Avatar for piscean123

[QUOTE=piscean123;464255]Peoples i have tried to make this simple progrem in C... that will print alphabets A to Z and their equivalent ASCII code.. like this A 65 B 66 . . . Z here is da source code...[/quote] Please use English. It's "[I]here is [B]the[/B] source code[/I]. Unless your name …

Member Avatar for Narue
0
147
Member Avatar for weasel7711

[QUOTE=weasel7711;459943][QUOTE=Ancient Dragon;459748]function printSentence at line 98: you have to save pointer [b]sent[/b] before executing lines 100 thru 102, then use the saved pointer in line 103 because as written that function is destroying the value of the pointer.[/QUOTE] do you mean something like this: [code=c++] void printSentence(char *sent){ *sent = …

Member Avatar for Narue
0
191
Member Avatar for joshmo

FORMATTING please.... SPACES and NEWLINES are your friend so the code can be read: [code=cpp] if ((time_and_date[i].start.hours <= 7 ) && (time_and_date[i].end.hours > 7) && (time_and_date[i].end.hours <=16)) { temp_rate = ((count_rate*60) + (time_and_date[i].end.minutes)) * 0.12; rate = (((time_and_date[i].start.minutes)) + (hour_rate*60)) * 0.15; rate_two = (rate + temp_rate); } if ((time_and_date[i].start.hours …

Member Avatar for Salem
0
116
Member Avatar for tech2chill
Member Avatar for The Dude

[QUOTE=joshSCH;463098]Hey man, you don't have to make a trivial comment to EVERY thread[/QUOTE] You mean like that one? :icon_twisted:

Member Avatar for Ezzaral
0
96
Member Avatar for Duki

[QUOTE=Duki;463631]My code (very few comments so far, sorry):[/quote] Why do people apologise for doing bad things rather than just doing what they know they should? :icon_confused: [QUOTE=Duki;463631][B]My problem is this:[/B] Every run of the program produces the same results. Same damage, same blocks, same double attacks, same winners, everything. I …

Member Avatar for Mouche
0
180
Member Avatar for pdwivedi

[QUOTE=pdwivedi;463661]can u help me what I am doing wrong in above program??[/QUOTE] Yes, read the link you were given twice. It tells you how to do what you want. If not, ask a [I]specific[/I] question.

Member Avatar for WaltP
0
125
Member Avatar for eranga262154
Member Avatar for rajgopal.uoh
Member Avatar for clski1973

What I'd do is program one step at a time. Using your last description, Start by writing an empty [ICODE]main()[/ICODE] Then write "[I]1. a void function to read in the three test scores and pass them back to main as reference parameters.[/I]" Test this by outputting the parameters after the …

Member Avatar for Duoas
0
308
Member Avatar for coolbreeze

And: [QUOTE=coolbreeze;463407] 3. Increase the value of variable x by variable y x= x+y;[/QUOTE] There's another way to do this. Look at double operators.

Member Avatar for WaltP
0
90
Member Avatar for aaabhish

[QUOTE=aaabhish;462795]my code is actually a long around 500 lines. so putting all lines of code is not a gud idea here. suggest me wr i put my codes so that you can have a look on it. and can provide needy solution to me.[/QUOTE] So add output statements to watch …

Member Avatar for Salem
0
164
Member Avatar for jacknight

Recursion means you call the function until you get to a specific condition. In this case, you might want to call the function again with [B]n-1[/B]. Then when you get to the [B]n==1[/B] you start returning and add all the values returned to get the value.

Member Avatar for jacknight
0
85
Member Avatar for nicz888

[QUOTE=nicz888;462851]ok that problem is solved. what i should't of done was put<<endl; at the end. i am stuck at this new problem. here is my problem: the user input a started date for a year, and let said Jan and a year 2000. so Jan 1 2000 started on sunday …

Member Avatar for vijayan121
0
95
Member Avatar for handsome_94
Member Avatar for pacman326@gmail

You don't need c_strings. Just look for the two characters that begin and end a value you want moved and use the [ICODE]substr()[/ICODE] method to move the value. And why are you indenting 3 miles? Too much indenting is almost as bad as no indenting. 4 spaces is enough for …

Member Avatar for pacman326@gmail
0
242
Member Avatar for meiyantao

[QUOTE=meiyantao;462890]Hello,my freinds: I'm writing a program with Qt4.The program can communicate with each other in a LAN. Now,may ererything be ok,but the constructor is wrong,the compiler tells the fallowing: [LIST=1] [*]main.cpp:4: error: new types may not be defined in a return type [*]main.cpp:4: note: (perhaps a semicolon is missing after …

Member Avatar for meiyantao
0
224
Member Avatar for redaqen

The basic flow of the program is not that complicated. You kept it simple enough. There are a few details, though.... First thing I notice is [ICODE]fscanf(fin,"%c", txt[j][i]);[/ICODE] Using [ICODE]fscanf()[/ICODE] to read a character is like opening your front door with C4. It works, but wouldn't a key be better? …

Member Avatar for Ancient Dragon
0
155
Member Avatar for skatamatic

[QUOTE=Narue;462215]>How do you clear the console screen without any system-compatibility issues? Start by altering reality such that standard C++ recognizes a "screen" and a "console" in a convenient way.[/QUOTE] In other words, brute force. Outputting a bunch of newlines '\n' is the only portable way.

Member Avatar for WaltP
0
2K

The End.