5,676 Posted Topics
Re: We've added CODE Tags for the last time for you. You already have 4 infractions and 1 warning for not using them. 1 more infraction and you will be banned. This constitutes your [I][B]last[/B][/I] warning. Follow the rules. | |
Re: First thing I'd do is simplify. These two statements [ICODE]llint diff = labs (start < end ? start - end : (start == end ? 1 : end - start)), *genList = calloc (diff, sizeof (llint));[/ICODE] [ICODE]*(genList + i) = i * byWhat * (diff > 0 ? 1 : … | |
Re: To return a string you have to pass it into the function as a pointer. The [iCODE]return[/iCODE] statement cannot return a string. Your [ICODE]for[/ICODE] statement at the end will never exit. And what are you calculating in [B]iResult[/B]? | |
Re: Do not hijack threads with your own questions... | |
Re: [QUOTE=girishn;1178530] Most everything works fine, except when I type Brent [ENTER] #, I get 6 other characters instead of just 5, one for each letter of Brent. I believe it might have something to do with the [ENTER] but I am not sure. Anyone have any ideas?[/QUOTE] That's exactly what … | |
Re: Ok, so did you look up what ^ does. Ok, maybe you should start there. | |
Re: Close. [CODE] void Clock::setClock() { UL h, m, s; cout << "please enter time in hours, minutes and seconds with a space inbetween eg. 23 59 59\n"; cin >> h >> m >> s; h+=h*3600;//hours to seconds m+=m*60;//minutes to minutes s+=s+h+m;//seconds for hours, minutes and minutes secs = s % … | |
| |
Re: I'm confused too. There is no formatting making the code difficult to read. There is no description of what you are having problems with. There is no information about what is confusing. Therefore, I have little to offer. | |
Re: [iCODE]fgets()[/iCODE] will read up to BUFFER-1 characters [B]or[/B] up to and including the '\n' in a line, whichever is smaller. So if your file contains [iCODE]ABCDEFG[/iCODE] and BUFFER is 6 you will have in your input [iCODE]ABCDE\0[/iCODE] or [iCODE]ABCDEFG[/iCODE] and BUFFER is 10 you will have in your input [iCODE]ABCDEFG\n\0[/iCODE] … | |
| |
Re: [QUOTE=Asheem;1178099]The program needs to read a file, in which position are mentioned in form of 0 and 1, and location (i,j), of the robot, who has to go the end point has to, generate numbers, randomly, BUT ALSO STORE THOSE LOCATIONS SO THAT THE ROBOT DON'T GOES TO THE SAME … | |
Re: threeDays[0][0] = 'M' threeDays[0][1] = 'o' threeDays[0][2] = 'n' threeDays[1][0] = 'T' threeDays[2][0] = 'W' | |
Re: [code] for (int n=0; n<=t.length()-1; n++) t[n]='*' [/code] Test for SPACE before executing the statement so you can skip over it. | |
Re: [QUOTE=ahmed hefnawy;1177918]...understood[/QUOTE] I think so. you want us to write it for you, and you can't be bothered to read the Member Rules. Both are mistakes on your part. | |
Re: Are you absolutely sure the file opens correctly? You need to test the return value of the file open to make sure it's really open. Can you guarantee that there are exactly 8 values in the file? What if there are only 7? Or 10? You should probably loop, reading … | |
Re: [QUOTE=atticusr5;1173250]Hey everyone here are my updated errors, and code, i have gotten them down too three now Errors: 1>assign10.cpp(273) : error C2065: 'Start' : undeclared identifier 1>assign10.cpp(274) : error C2065: 'Start' : undeclared identifier 1>assign10.cpp(275) : error C2065: 'Start' : undeclared identifier [/QUOTE] break the error down into pieces: [B]Start[/B] … | |
Re: Rewrite your calculation section so it's doesn't use tricks. Make it straight forward and simply output each calculation. | |
Re: [QUOTE=bill_;1172656]i changed the array and the output is still the same. (random symbols). Also i thought that array[3] had 4 memory slots. so that is why i had the array number set to 1 less then wat i needed[/QUOTE] Why would [B]array[3][/B] have [B]4[/B] slots? It only has 3, as … | |
Re: No it's not portable at all. That's why it's not recommended. C/C++ does not have a standard way to accept input without a Return. | |
Re: What do you think setw() does given how you used it? What is displayed and what did you expect it to display? | |
Re: Do not use [iCODE]fflush(stdin)[/iCODE]. [url=http://www.gidnetwork.com/b-57.html]Here's why[/url]. Reading the meaning, you are only reading 8 characters. Isn't the meaning longer? And you did not explain well enough what the problem is. What is the result of the code? | |
Re: After you read the last number, you still have the end-of-line in the file. here's where [ICODE]getline()[/ICODE] can clean up the EOL. Since you didn't describe in detail what's really happening with the second line, that's my guess. But using [ICODE]getline()[/ICODE] to read each line and parsing the line is … | |
Re: Then 1) the batch file is not in the directory specified 2) the system call is not being executed 3) the batch file is being executed and give no feedback 4) the program is not working fine Maybe more details are necessary. | |
Re: [url=http://bdn.borland.com/article/21751]Turbo 1.01[/url] [url=http://bdn.borland.com/article/20841]Turbo 2.01[/url] | |
Re: [B]sl[/B] is a string class, and [iCODE]strcmp()[/iCODE] works only on char*. Use the string class for [B]owner[/B] and [B]pass[/B] and you can simply use == to do the compare. | |
Re: [code] cout << "So, type the missing number here: "; cin >>f; if (f==5) cout << "Well done!\a\a\a"; while (f!=5) { cout << "Wrong answer, try again!\nEnter the number here: "; cin >> f; } return 0; }[/CODE] Look more closely at this piece of code. If you enter 5, … | |
Re: [QUOTE=gorgey506;1174269] What did i do wrong[/QUOTE] Didn't use CODE tags Didn't tell us what problem you are having. HTH | |
Re: You need to completely understand the [B].doc[/B] format in order to split a document properly. Do you understand the headers and all? | |
Re: [QUOTE=tinkeydo;1174284] I would like for the program to be able to "delete" any character and all of its information from the text file. I believe this involves reading and copying the text file until it reaches the characters name than skipping that line and the next four informational lines before … | |
Re: 'y' and 'n' are already characters. You cannot define them as [I]char[/I] | |
Re: [QUOTE=timbomo;1174447]i got errors and i cant find out what they meant i have went down the program line by line trying to figure them out and i am having no success. I am trying to use call by call values and parametrers n this program. (list of errors are below)[/quote] … | |
Re: you need to look up the parameters for [I]rand()[/I]. You obviously missed something. | |
Re: [QUOTE=Nick Evan;1171352][QUOTE=Xlphos;1171314]I have found my self replying to threads that are weeks old. I could edit the post but would removing all the text remove my post?[/QUOTE] If you made a descent reply, then why want to delete it?[/QUOTE] And if you didn't make a decent reply, why not? :icon_mrgreen: … | |
Re: Take it a step at a time. Initially, forget the class itself. How would you represent a [B]Bigint [/B]value? As a long? As an array? What makes the most sense for 20 digits? Conceptually, how would you do an operation on this value? Now write an input and output function … | |
Re: [QUOTE=rockstar8577;1173346]I think im gonna do Win32 api, i just need to find c++ tutorials, not ones in c[/QUOTE] Win32 api should work the same in C as C++. All you need to do is call the functions properly from your C++ code. The C tutorials should help you just fine. | |
Re: No, a [I]statement[/I] is bolded and underlined. The error is missing -- you have to post it. | |
Re: Your understanding is faulty. You cannot pass a string into the [B]is[I]xxx[/I]()[/B] functions. You pass in a character and the return is non-zero for TRUE and 0 for FALSE. | |
Re: All programs start with a clearly defined concept and clearly defined design. Do you have a clearly defined process for keeping someone on task? | |
Re: First thing is [B]var[/B] is a reserved word. Don't use it as a variable. Second, you went to the trouble making [iCODE]IsEvenNumber()[/iCODE] but you don't call it. | |
Re: [QUOTE=COKEDUDE;1173384]Can someone please explain why this function will not compile. [/QUOTE] It would be better if [I]you[/I] explain why you think it doesn't compile. I assume the compiler says something to lead you to that conclusion. By posting what it says, we can tell you [I]exactly[/I] why, and we won't … | |
Re: At the very beginning of the program, open a file names [B]XXX.XXX[/B] for writing. Write something (anything) into it. Close the file. Now search for the file [B]XXX.XXX[/B] on disk. When you find it, that is where your input file must be. Move it there. Delete that new code and … | |
Re: What I would do is whether you find a solution or not, just keep looking. IOW, when you find the first solution, save it in a file. Then just continue looking as if you didn't find a solution. Eventually, you should find them all. | |
Re: [url=http://c-faq.com/expr/evalorder2.html]This is why[/url] you can't do what you posted. | |
Re: [QUOTE=smeghead007;1171682]Ok what I need to do is utilize a binary search algorithm and determine the index location of a set of keys. The keys are in the file the user enters along with the numbers that have to be searched through. But im lost on how to do this. Do … | |
Re: Start by describing how you can tell if a number is prime. | |
Re: And you want us to do it for you? That's not what we do here. You write it, and we help you fix it. |
The End.