5,676 Posted Topics

Member Avatar for XCal1ber

[QUOTE=XCal1ber;517393]It worked, thanks! Now, what did you mean in your first post? > The code you posted has a major flaw though. You don't want to check the entire size of the buffer szword but only the number of characters the player typed. In C that would be strlen(szword). oh, …

Member Avatar for Narue
0
267
Member Avatar for mrjoli021
Member Avatar for jmvr_danga_14

[QUOTE=jmvr_danga_14;512044]i have another problem...! do you know about a star algorithm? our professor required us to put this kind of algorithm to our program..so does any one know what's this algorithm and how it works? also how will i incorporate this algorithm to our program..tnx...[/QUOTE] If he requires it, he …

Member Avatar for WolfPack
0
2K
Member Avatar for chihuyu

[QUOTE=chihuyu;510746]Hello,I am new for C++.The following are the codes I wrote to calculate the sum of 2^n. The result is 2046 after running the program.That is correct. But when I change the condition to n<=100,the result comes with -2,which is obviously wrong.Then I tried different n and found if n<=30,the …

Member Avatar for technogeek_42
0
124
Member Avatar for k2k

[QUOTE=k2k;511891]the array size, i, is supposed to be 271.. i set x = i-1 //270, the last index for cout...... and then i-- ,,,, up to 0....... i don't know why it doesn't read or display from the beginning of the txt file eventhough if i test with a code …

Member Avatar for WaltP
0
91
Member Avatar for wollacott

[QUOTE=wollacott;511801]but will my code work if i enter one single digit?[/QUOTE] What happened when you tried it? You are basically asking us to write your program for you.

Member Avatar for WaltP
0
98
Member Avatar for Narue

[quote=Grunt;248894]Even I am not sure what he meant but I didn't ask because that would have spoiled his fun :D[/quote] See Wolfpack's signature...

Member Avatar for bector
2
8K
Member Avatar for nurulshidanoni

Where is [I]your[/I] attempt at it? You should know by now we won't do the work for you.

Member Avatar for nurulshidanoni
0
167
Member Avatar for xs.usman

And in simpler terms... 1D array: The list of TARGET stores in one city. -- Store numbers 1,3,5,7,9 in Detroit 2D array: The list of Target stores in each state by city. -- in Michigan: ---- 1D array for Detroit ---- 1D array for Pontiac ---- 1D array for Lansing …

Member Avatar for WaltP
0
681
Member Avatar for anallan

[QUOTE=anallan;505640]here's the code that i've done but it doesn't work correctly..can someone help me out?[/QUOTE] First off, please be a little clearer. [I]Explain[/I], don't just say it doesn't work. [I]Why[/I] doesn't it work? What [I]does[/I] it do? What I'd do is immediately after the FOR, start the WHILE (or preferably …

Member Avatar for anallan
0
671
Member Avatar for isocam

You need to know what the format of the data file is ([I].dat[/I] is for data file, I assume saying it's a program is just to throw us off ;)) IOW, you need to know how each byte is defined, whether it's a byte, word, long, character, float, etc, in …

Member Avatar for tom curren
0
402
Member Avatar for bhagyashanti

[QUOTE=vishesh;508377]Use you command promt and run. Or if you want to run it directly add [icode]std::cin.get()[/icode] at the end of main() to wait for [B]a keystroke[/B]. However this wont work under certain circumstances as mentioned [URL="http://www.daniweb.com/forums/thread90228.html"]here[/URL].[/QUOTE]Actually, wait for [I]an ENTER[/I] :icon_wink: [QUOTE=Salem;508389]Was that first post meant to be a [URL="http://en.wikipedia.org/wiki/Haiku"]Haiku[/URL] …

Member Avatar for WaltP
0
139
Member Avatar for savio_1987

[QUOTE=savio_1987;508556]i saw the libary there are a few commands like biascom in bios.h, i feel that will do the job of getting the values from the serial port. but how do i transfer it on to a test file??[/QUOTE] First things first. Read data from the serial port. Don't try …

Member Avatar for WaltP
0
203
Member Avatar for mr_fake

Look up the function [url=http://www.cplusplus.com/reference/clibrary/ctime/][I]time()[/I][/url] and it's friends.

Member Avatar for WaltP
0
81
Member Avatar for smile!

Of course there's output. You have [I]cout[/I] statements in your code. Unless you're not telling us the whole story. Explain [I][B]exactly[/B][/I] what is happening, and [I]why[/I] it's wrong. Examples are easier for us to understand. And about "[B]I WANT IT FOR TOMORROW[/B]" -- we don't care. You should have posted …

Member Avatar for wamuti
0
114
Member Avatar for np2100

To explain what [B]Wee[/B] is telling you... [QUOTE=iamthwee;507364]Loose the '' around the numbers. i.e '2' becomes just 2[/quote] You don't need to loosen anything, you need to [I]lose[/I] something... :icon_rolleyes: '2' is the ASCII character, 2 is the number. You need to compare the number 2, not the character. Same …

Member Avatar for WaltP
0
87
Member Avatar for kfupm

My hint #1: Use a [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies#faq_keep_it_organized]better title[/url]. Something like [I]Creating a Date Histogram[/I]. Also, [url=http://www.daniweb.com/techtalkforums/thread78223.html]Read This[/url]

Member Avatar for WaltP
0
96
Member Avatar for Barefootsanders

121 posts and you still can't make a proper title? And you should know by now most of us won't help without posting code, nor will we download it.

Member Avatar for WaltP
0
98
Member Avatar for sana_akram

Problem #1: Your title. [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies#faq_keep_it_organized]See this[/url] [QUOTE=sana_akram;505990]can we send the input from command prompt screen ...[/quote] Problem #2: A command prompt [I]screen[/I] does not contain input. A screen is an [I]output[/I] device. [QUOTE=sana_akram;505990]....to the text file in C++ [/QUOTE] Problem #3: C++ does not contain a text file. C++ can …

Member Avatar for WaltP
0
108
Member Avatar for csteverun

Examples [code] 1100100101001001 11111111 ---------------------- 00000000[B]01001001[/B] buff gets 01001001 1101110110110011 11111111 ---------------------- 00000000[B]10110011[/B] buff gets 10110011 [/code]

Member Avatar for csteverun
0
153
Member Avatar for uthnim

[QUOTE=rajatC;505773]i also used it in assembly language the code was 0dh,0ah...someone asked me what does each byte mean? please explain!![/quote] 0Dh is carriage return. Return to the beginning of current line. 0Ah is a line feed. Drop down to the next line. In assembly you don't have the luxury of …

Member Avatar for Duoas
0
140
Member Avatar for tehprince
Member Avatar for hashinclude
Member Avatar for hashinclude
0
480
Member Avatar for Srynx

Hmmm, badly formatted code. Anytime we see [code] } } } [/code] we know we're not going to be able to follow the code easily. [url=http://www.gidnetwork.com/b-38.html]See this[/url] and format your code properly. And please don't post code without some kind of explanation. New people can't necessarily understand uncommented code without …

Member Avatar for CPLUSCPLUS
0
672
Member Avatar for raniajay

[QUOTE=rajatC;500081]write a function for factorial and sum its digits and check for equality...it's simple..isn't it??? do u want a complete code?? if yes then sorry..nobody will help you here for that...[/QUOTE] Good point. [QUOTE=rajatC;500114] ... this function returns [B]sum of the factorials of all the digits[/B] of a given numbers …

Member Avatar for rajatC
0
101
Member Avatar for Jishnu

[QUOTE=iamthwee;496431][aside] I'm mighty popular all of a sudden, that's really flattering[/aside][/QUOTE] Yeah, but it's generally not the type of popularity that's healthy... [QUOTE=iamthwee;497053]Those type of comments are written in such poor taste. Something should really be done about that, as I'm sure if that were an actual post, a warning …

Member Avatar for invisal
2
193
Member Avatar for sa-al

[QUOTE=sa-al;500103]hello i have changed my previous code about converting a statement to reverse polish notation but still i think it has serious problems .can any one help me solve it? i have just a little time![/QUOTE] You [I]think[/I] you have a problem? What makes you think so? Have you read …

Member Avatar for invisal
0
116
Member Avatar for silent_letter

[QUOTE=silent_letter;500513]I am a new learner of C and I tried to write a program about searching a keywrod from a .txt file and counting the number of time that the keyword repeats My program is below...it can't work...and I can't understand why.... can someone please help me...T_T Thank you [/QUOTE] …

Member Avatar for silent_letter
0
164
Member Avatar for zeroground

[QUOTE=zeroground;498838]i want c++ ...can u write the code please ...i need it urgent[/QUOTE] Did you fix the errors? When you do, repost and ask questions. Do NOT ask us to do your work for you. And stop using QUOTE tags when you need CODE tags.

Member Avatar for toko
0
103
Member Avatar for zeroground

And stop making multiple threads on the same stupid with the same stupid title. Please read the RULES.

Member Avatar for invisal
0
182
Member Avatar for wijitha

You have to format the stamp yourself from the information received from the functions [B]Ancient Dragon[/B] suggested you look into.

Member Avatar for Ancient Dragon
0
906
Member Avatar for AbberLine

[QUOTE=AbberLine;495952][code] do { if(getch()){ switch (getch()){ case UP: hook_up(); break; [/code] but it dosn't do thins the way i would like them to be done. Again I translated some variable or function names. What happens now is that I need to press a movement key twice to get it happen. …

Member Avatar for AbberLine
0
387
Member Avatar for carobee
Member Avatar for ssharish2005
0
140
Member Avatar for Karkaroff

Your problem seems to be trying to get your input commands to do the processing for you. That's difficult at best. Just read in the entire line as suggested and look at the line character by character. That is basically all [icode]cin.get()[/icode] does anyway.

Member Avatar for Karkaroff
0
115
Member Avatar for mr.cool
Member Avatar for Narue
0
97
Member Avatar for jobs

[QUOTE=jobs;496228]When you read file in C and move to next line and so on. This seems you have to access file top to bottom sequentially without skipping lines. I need a way to read very 5th line or something similar to it. I am just concerned with data that is …

Member Avatar for yagiD
0
108
Member Avatar for Deadvacahead

Do the program in small steps: 1) Start by reading each question and all the answers into 6 strings. Continue until all questions read. 2) Next step, read as above and write all but your answer to the new file. 3) Third step, after reading, look at your answer and …

Member Avatar for n.aggel
0
158
Member Avatar for rajatC

[QUOTE=rajatC;492233]long int??? for what??? sorry i didnt get ur point.. i m using double to store the number of total permutation and an integer array[n] to store different permutations of n numbers...[/quote] [I]Double[/I]s are inexact. You can't have 2354.34 permutations. Therefore [I]double [/I]is a bad choice. [QUOTE=rajatC;492233]And [B]how will long …

Member Avatar for Jishnu
0
231
Member Avatar for Jishnu

[QUOTE=Jishnu;495194]This happens because new posters like Knightzs are not fully aware of the rules over here. [/QUOTE] And why is that? Aren't the rules clear? :icon_wink:

Member Avatar for Jishnu
0
60
Member Avatar for evilseed187

[QUOTE=evilseed187;493473]I need help with beginning code to simple game of hangman in C++ Don't know where to start and it is due in six hours.[/QUOTE] Start with ignoring the code [B]jaepi[/B] pointed to. It doesn't work, and it's not that great. Did you miss reading the post titled [url=http://www.daniweb.com/techtalkforums/thread78223.html][b]Read Me:[/b] …

Member Avatar for Salem
0
122
Member Avatar for people123

It would make more sense to use HEX values rather than DECIMAL. 223 is relatively meaningless, but 0xDF makes sense since each character is immediately translatable into binary: D = 1101 F = 1111 223 would be considered a 'magic number' and should be avoided.

Member Avatar for people123
0
139
Member Avatar for varsha0702

You are attempting to read a single character, right? When you enter that character, what key(s) to you type? The character and ENTER, right? Well, the ENTER is also put into the input buffer, but when you read a single character, only the first character was removed from the buffer. …

Member Avatar for Beair.GQ
0
134
Member Avatar for nugget93

In strings, the \ character is the first character of a pair, like \n, \t, etc. If you want a \ in a string you need to use \\.

Member Avatar for Ancient Dragon
0
97
Member Avatar for mjoshi

[QUOTE=mjoshi;493267]I tried the following way and it doesnt work:[/quote] [code] if (cbuff[0] == '#' && cbuff[2] == 'N' && cbuff[3] == 'a' && cbuff[4] == 'm' && cbuff[5] == 'e')[/code] Instead, how about [code]if (strncmp(cbuff, "# Name", 6)[/code] Next: [code] strncpy (name, cbuff+8, 6); name[6] = '\0'; strcpy(filename, name); strcat(filename,"_TAUTOMER_"); …

Member Avatar for Narue
0
139
Member Avatar for np2100

You should scrap this code completely. You need to look into the values of characters. For example, the letter 'A' is the same as the integer value 65. Run this program and see the correlation between characters and numbers. Then think about your idea with [I]this[/I] information in mind. [code=cpp] …

Member Avatar for np2100
0
128
Member Avatar for Srynx

[QUOTE=Srynx;462728]Hi, I've wrote all code using using matrices and the problem happens even more often.[/QUOTE] So rather than fix it, you took out what you were supposed to learn? [QUOTE=Srynx;462728]I've tried it in another compiler (DEV-C++) and with this one program just doesn't run.[/QUOTE] That should tell you something. The …

Member Avatar for Srynx
0
136
Member Avatar for Butterflieq

The array being filled with the order could simply contain the item numbers being ordered, one element per ordered item. Example, if the array contained 1,1,2,1,3,3, then 3 dogs, 1 fry, and 2 lemonades were ordered. Then at end of order, use each element of the array as an index …

Member Avatar for neosomosis
0
150
Member Avatar for jobs

Do you really want your operating system to do the logging? Or do you only need a file created with log entries in it?

Member Avatar for WaltP
0
1K
Member Avatar for nicz888

[QUOTE=nicz888;492476]:)[/QUOTE] What was that post? A bump? Never bump your messages. Someone will get to you when they log in. [code=c++] string == strcat(string," "); string == strcat(string,temp); [/code] What do you think these lines are doing? I'll bet it's not what you expect.... [QUOTE=nicz888;492476]$ is a weird character that …

Member Avatar for neosomosis
0
126
Member Avatar for manster

[QUOTE=manster;492628]I'm clueless as to how to fix the errors in this contact information manager program. please help. Thanks in advanced[/QUOTE] You're welcome in advance. Out of 290 lines you aren't really asking us to guess what lines have errors and what the errors are, are you? Details, please...

Member Avatar for Nick Evan
0
945

The End.