5,237 Posted Topics
![]() | Re: [url]http://cboard.cprogramming.com/showthread.php?t=94841[/url] ![]() |
Re: 1. Your target array is empty. I'm kinda wondering how it compiles personally. 2. Your ship array has only 2 entries, so [INLINECODE] for (int i=1; i<3; i++)[/INLINECODE] should be [INLINECODE] for (int i=0; i<2; i++)[/INLINECODE] 3. [INLINECODE]if (ship[i].visible=true)[/INLINECODE] You probably meant == here. But since visible is a boolean … ![]() | |
Re: What's obvious is that you failed to read Announcement: [URL="http://www.daniweb.com/forums/forum118.html"]Please use BB Code and Inlinecode tags[/URL] and the watermark at the back of the edit window. If you had, that code would not be an unformatted mess. Fewer people are prepared to even look at unformatted code. | |
Re: > Did you know that banks in the US mail out 8 billion credit card applications every year! And they wonder why there is so much fraud? A couple of years ago, I was getting one or two of these PER WEEK. Some of them were disasters waiting to happen … | |
Re: Pasting the first 100 lines (so we see everything upto the first error line number, and a bit beyond) would be helpful. | |
Re: Add a [URL="http://en.wikipedia.org/wiki/Finite_state_machine"]FSM[/URL] to your program. Eg. [code] enum state_t { normal, comment_start, in_comment, comment_end }; [/code] Then you do say [code] int ch; state_t myState = normal; while ( (ch=fgetc(fp)) != EOF ) { if ( state == normal ) { if ( ch == '/' ) { // … | |
Re: > Never mind i found a similar question that had an answer in it And when your combined google skills and nagging skills fail to deliver a working program you can pass off as your own work, you're going to crash out of the course in spectacular fashion. | |
Re: Are we supposed to guess what the types are for your variables? Was the program that much longer that you thought you would edit them out for convenience? | |
Re: > 1.) Would this program be better as a while loop so it is continous or a for loop? Flip a coin, make a choice. I don't think there is a lot in either choice. Both need to check the array limits (which suggests [B]for[/B]) and the magic value from … | |
Re: Does messenger have an "export/import" contact lists option? I've used this approach in the past to edit details using a text editor in a few minutes which would have taken many hours to do via the user interface. | |
Re: The fact that your syntax colouring has gone haywire should be a big hint to what's amiss. And would it kill you to use some indentation (or indeed any white space). | |
Re: Check the paths in the project settings, and add to the linker search path the location where that library is stored. > i am using turbo c++ 3.0 and my os is win xp So when were you planning to join this millennium? | |
Re: My answer is [URL="http://forums.devshed.com/c-programming-42/looking-for-memory-leak-advice-482089.html"]here[/URL] | |
Re: Sounds like bad copying on your part, replacing a pointer with an array. | |
Re: [url]http://isweb.redwoods.cc.ca.us/INSTRUCT/CalderwoodD/diglogic/half-add.htm[/url] Are you writing a simulation of some sort? Because most processors come with some kind of 'add' instruction which does the whole job for you. | |
Re: Nor appreciating that every time you see something like " Last edited by Ancient Dragon : 39 Minutes Ago at 13:22. Reason: add code tags" it represents time sucked away from helping people and instead wasted on doing what the poster should manage for themselves. Read [B][URL="http://www.daniweb.com/forums/announcement118-3.html"]THIS[/URL][/B] > [INLINECODE]for( counter= … | |
Re: How about talking to the s/w manufacturer which presumably sells the dongles with the s/w as a protection mechanism. Ask them how to run their s/w on a laptop with only USB ports, maybe they'll supply you with the appropriate h/w. | |
Re: If you managed to do gcc -o header.h prog.cpp then yes, you will lose the header file. Which IDE are you using? [URL="http://cboard.cprogramming.com/showthread.php?t=93056"]A recent incident[/URL] | |
Re: > gets(stringarray); Would be replaced initially by [INLINECODE]fgets( stringarray, sizeof stringarray, stdin );[/INLINECODE] But this will leave the \n in the result, if one was found. If that would cause a problem, then it can be removed with [INLINECODE]{ char *p = strchr(stringarray,'\n'); if ( p ) *p = '\0'; … | |
Re: If there is no OS, there can't be a file system either. How are you proposing to load the .WAV file to be played? How are you going to locate the appropriate audio device? | |
Re: Something like [code] ifstream inf("F://value.txt"); ofstream outf("F://distance.txt"); while ( inf>>x.X1>> x.Y1 >> x.X2 >> x.Y2 ) { d = distance ( x.X1, x.Y1, x.X2, x.Y2 ); outf<<d; } [/code] | |
Re: > totalfica=totalfica++; Try just totalfica++; as what you tried is undefined, and quite likely to not produce the result you were expecting. | |
Re: By telling us which OS/Compiler you're working with for starters. And you also need to make sure you have a file system which records such information. | |
Re: There's also not [URL="http://www.daniweb.com/forums/thread93062.html"]posting the same thing in several forums[/URL] and choosing [URL="http://catb.org/~esr/faqs/smart-questions.html#bespecific"]a decent topic title[/URL] | |
Re: What about reading the manual? [url]http://clusty.com/search?query=gnu+ggcov+manual&sourceid=Mozilla-search[/url] | |
Re: You can't use a single memcpy() because your int**data1 isn't all in contiguous memory. Use a pair of for loops to copy each data1[row][col] to the correct place in your new data3 array. | |
Re: Is machine.cpp in your project / makefile? Do you ever see machine.cpp being compiled when main.cpp is compiled? | |
Re: > fgetpos((FILE*)hFile, &lpNewFilePointer); Simply casting things to make the compiler shut up doesn't work. What is HANDLE (really). It seems rather too much like a Win32 thing to me. | |
Re: It's not a re-declaration, just a useless out-of-bound reference to an element of the array. > for (row = 0; row <= NUM_ROWS; row ++) This too steps off the end of the array. > for (seatLetter = 'A'; seatLetter <= 'F'; seatLetter++) And how to the upper case letters … | |
Re: Post #4 was the answer on a plate, what more do you want? | |
Re: > If someone knows why this is happening, that would be great. I've got two pretty good ideas where the problem is (ok, 3 actually). > while (getline(fin, line[counter])) What stops this over stepping the array? > for(counter=0; counter<5000; counter++) Why 5000 and not the number of lines you read?. … | |
Re: Well while you're thinking about it, consider improving your English. [url]http://catb.org/~esr/faqs/smart-questions.html#writewell[/url] Some boards might tolerate the kiddie speak, but this board doesn't, and there's no way you'd get a job if your CV looked like that. Also, there seems to be a [URL="http://www.daniweb.com/forums/thread91821.html"]rash[/URL] of people unable to think for themselves. | |
Re: In answer to post 1 [url]http://www.daniweb.com/forums/announcement118-2.html[/url] "You attempt, we help", that's the deal. In answer to post 2 [url]http://catb.org/~esr/faqs/smart-questions.html#urgent[/url] Learning to plan your work-load is just as important as all the technical skills. | |
Re: Well did you take my hint from last time, about working it out on paper? | |
Re: There seems to be something wrong with [URL="http://www.daniweb.com/forums/announcement118-2.html"]your eyesight[/URL]. And just for saying "urgent", read [URL="http://catb.org/~esr/faqs/smart-questions.html#urgent"]this[/URL] as well. We're not here to be your google lackeys, nor provide code for you on demand based on some vague 1-line spec. | |
Re: Well until you post code, and tell us which OS/Compiler/Graphics library you're using (not that I'm expecting it to be anything other than fossil TurboC and BGI), don't expect an answer. The way to make the curve appear smoother is to reduce the interval between sample points. | |
Re: So, apart from - using gets() - using void main - it doesn't compile - very poor indentation What is your actual question? Because it looks to me like you wrote the whole thing in one sitting, tried to compile it, got a whole raft of errors and have now … | |
Re: As a rough guess, you remove any "-O" options and add a "-g" option to the CFLAGS make variable. Whilst GDB can debug files with optimisation enabled, it does make for some very weird single-stepping. | |
Re: Well which OS/Compiler are you trying to compile this on? The last 4 header files all belong to Unix/Linux and other POSIX systems. As for occi.h, I've no idea. | |
Re: [url]http://c-faq.com/lib/notveryrand.html[/url] You might want to check on the quality of your rand() function. ![]() | |
Re: > its feeding a mass of people in one place that he is being taken to court for. Does that include restaurants? What about roadside hotdog stands? | |
Re: Well objc is for objective-c (another language variant), so I've no idea why you would even be trying to link with it. | |
Re: Well your haphazard approach to using { } to mark blocks of code (and general poor indentation to start with) means that your code returns almost immediately without doing anything. [code] if ( num <= 1 ) cout << "Please Enter another number: " <<endl; return 0; [/code] You might … | |
Re: Well how do you add two numbers on paper? Work right to left, and introduce the idea of 'carry'. | |
Re: > Just goes to show the power we give advertising Elmo was SO last year, just like the thread you dug up from the graveyard. | |
Re: Well the first step is to being with the program which simply copies the file to somewhere else. If you can't manage that, the rest of the assignment is out of reach. [code] FILE *in = fopen("file.txt","r"); if ( in != NULL ) { int ch; while ( (ch=fgetc(in)) != … | |
Re: > I was thinking too much into the matter, and the correction was just the use of global declaration. Why not pass the limit as another parameter? | |
Re: > I am new to C/C++ and this week we just started object oriented C++ So which is it, C or C++? C/C++ is walking down the middle of the road with traffic heading towards you from both directions. Sooner or later, it's not going to be a pretty sight. … | |
Re: > just put a ' cin.get (); ' at the end of the loop This was not worth waiting 2 YEARS for. |
The End.