5,237 Posted Topics
Re: Useless copy/paste spam - forget it [url]http://www.google.se/search?hl=sv&q=%22from+amazon+do+you+have+to+use+a+creit+card%22&btnG=S%C3%B6k&meta=[/url] Same thing all over the place, typo's included. | |
Re: Yes you can do that. But details do vary from one compiler to another (and the kind of machine you're running on). | |
Re: Or if you want to do a true pointer to a 2D array, like this: [code] #include <iostream> using namespace std; int main() { int array[2][5]={ {1,2,3,4,5}, {6,7,8,9,10}, }; int (*ptr)[5] = array; cout << "The value at the start of row 0 is: " << (*ptr)[0] << endl; ptr++; … | |
Re: > although for the assignment purposes, the program is 100%. Your assessor missed a big mistake then. > if ( Discriminant < 0) Oops - too late! You've already done the sqrt() on a negative number. | |
Re: If you're just going to call system() a bunch of times, there is little point in making it a C program. It would be far simpler and quicker just to make a shell script. It's not that it can't be done, it's just way too much effort to be worthwhile. | |
Re: You should be able to find a lot of them here. [url]http://predef.sourceforge.net/index.php[/url] | |
Re: Well you could direct the output to a file, then invoke notepad with that file. Would that work? Making it one step shorter could get unbelievably messy in a hurry, and for what benefit? ![]() | |
Re: > my question is what are the stop conditions of the ant colony system algorithm. All the ants are dead. | |
Re: Which version of windows? Which browser (and version)? Have you installed any plugins recently? [attach]13496[/attach] You can either turn it off for non-essential windows programs, or add an exception for your browser. But it shouldn't really be executing data as code to begin with. | |
Re: > Range("B3:B2000").Value = Range("B3:B2000").Value What does this do? Not a lot as far as I can see. | |
Re: [url]http://lmgtfy.com/?q=dbf+file+format[/url] Then try "library" as another search term. | |
Re: <vader> I sense a presence in the source, a feeling that I've seen this .... [URL="http://www.daniweb.com/forums/thread257218.html"]before[/URL] </vader> | |
Re: You want a search engine and a nappy change :@ Rolling here demanding things left right and centre without so much as a "please or thankyou" and without showing ANY effort beforehand. 5-year old's in a candy store have more manners than you. | |
Re: > before the function calls, it works fine. Put it after, error. That's because your C doesn't allow mixing declarations and statements. It's allowed in C99, but you don't have a C99 compiler. You will have to use malloc. | |
Re: [URL="http://www.daniweb.com/forums/announcement8-2.html"]Write a program based on the agent model in which two agents the teacher and student converse over laziness that affects students.[/URL] | |
Re: > data[i*n+i] = 1.; Well this would appear to walk MASSIVELY off the end of the allocated space. You need to allocated n*n for a square matrix. | |
Re: Do you have a menu option for "Character Encoding"? Because it looks like UTF-8 encoded UNICODE to me. | |
Re: [URL="http://forums.devshed.com/c-programming-42/c-and-assembly-undefined-reference-to-673221.html"]http://forums.devshed.com/c-programming-42/c-and-assembly-undefined-reference-to-673221.html[/URL] Kinda annoying, you know.... [url]http://www.catb.org/~esr/faqs/smart-questions.html#forum[/url] | |
Re: Lots of questions [url]http://clusty.com/search?query=programming+contests&sourceid=Mozilla-search[/url] Why do you want the answers? If the book is crap to begin with, then the answers to the questions are equally brain-damaged anyway. You're better off not looking at them most of the time. | |
Re: [url]http://www.daniweb.com/forums/announcement8-2.html[/url] And no it isn't [url]http://www.catb.org/~esr/faqs/smart-questions.html#urgent[/url] | |
Re: [url]http://www.daniweb.com/forums/announcement8-2.html[/url] Simply dumping your assignment isn't enough. | |
| |
Re: > int main(int num1, char op, int num2) Read your book again. You can't just make up an interface for main. It's [ICODE]int main ( int argc, char *argv[] )[/ICODE] [ICODE]argc [/ICODE]tells you how many args there are each [ICODE]argv[i] [/ICODE](from 0 to argc-1) is a string parameter. | |
Re: [code] #lqfoxgh <vwglr.k> #lqfoxgh <fwbsh.k> fkdu hqfubsw(fkdu fk) { li ( lvxsshu(fk) ) { fk = fk - 'D'; fk = fk + 3; fk = fk % 26; fk = fk + 'D'; } hovh { fk = fk - 'd'; fk = fk + 3; fk = fk … | |
Re: > this is not homework but rather my work I'm shocked that someone with a programming job can't solve this trivial problem :-O | |
Re: [url]http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus[/url] At a guess, you need two drivers - one to talk to the bus (bash the bits back and forth) - one to talk to the device at the other end of the bus. The first is fairly general, it can be used to talk to anything on the … | |
Re: Is it a homebuilt machine? Has it been overclocked or otherwise modified for extra performance? Have you searched for "<name of motherboard> + beep" ? Are all the fans working (at full RPM)? Some games will stress the machine quite a lot, so my guess is that it's some diagnostic … | |
Re: You need to post some of the source code instead. There is almost no information to work with based on what you've posted. | |
Re: I believe the emacs spell checker is restricted to just comments and string constants when spell-checking code. | |
Re: Can you use an index to access a list? Can an iterator ever be out of bound on a vector? | |
Re: > Why does the question use two asterisks in front of headOfList? So you can return a modified list. > Is it different from using one asterisk? Yes. > I don't understand why. How many characters (as a string) can you store in nm ? | |
[url]http://www.daniweb.com/forums/thread252440.html[/url] gets me this error message [quote=daniweb_server] Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 3842759 bytes) in /home/daniweb/httpdocs/forums/includes/class_bbcode.php(172) : eval()'d code on line 150 [/quote] I'm assuming the OP has pasted a bitmap (or some other stupid thing) into the message, rather than an attachment. | |
Re: You could add these two lines before invoking python [code] echo %CD% pause [/code] Adding a pause at the end as well would be good, in case it is reporting errors. Also, calling it a .cmd file would be preferable to a .bat file. IIRC, there's some historic "backward compatibility" … | |
Re: > please let me know whether this method is correct or not. You mean you can't tell? Does it, or does it not output a list of prime numbers? I'm sure it could be more efficient, but first you need to make sure it produces the right answers. | |
Re: Is that it? C'mon, make an effort FFS. The code is 90% C++ to begin with. Rip off the static void main and the damn thing will very nearly compile as C++. Well it ought to be close enough for you to at least have an attempt yourself. Being able … | |
Only this time, it wasn't. My reply to [URL="http://www.daniweb.com/forums/thread254052.html"]this thread[/URL] is there in the singular. But I also got a "This forum requires that you wait 15 seconds between posts. Please try again in 1 seconds." I rather suspect had it timed out differently, it would have been a double … | |
Re: And we want you to read this [url]http://www.daniweb.com/forums/announcement118-2.html[/url] | |
Re: > I got this question from a C problem set. Which one, I feel like complaining to them about posting crap. | |
Re: [url]http://www.daniweb.com/forums/thread256683.html[/url] | |
Re: Errors are reported where they are noticed, not where they occur. If the current error message on the current line doesn't make sense, then you need to start looking back through the code to see where it all started to go wrong. Eg. [code] int a int b; [/code] could … | |
Re: Just one of many buffer overflows in your program. strcpy(operatorRecord[1].expirationDate, "05/17/2048") ; You set MAX_DATE to 10, but you actually need 11 chars min to store this string. You forgot to count the \0. You also need to pass the number of array elements to writeData | |
Re: Talk to the person you bought if off perhaps? If they don't know, was it stolen (especially if you got it really cheap from some guy on the street)? | |
Re: I would suggest you use [ICODE]std::string[/ICODE] for all your strings. Not raw allocated char pointers. I can see plenty of places where - you're not allocating enough memory - you're not freeing memory you have allocated - you're not counting the \0 to mark the end of the string - … | |
Re: > When you look at my output you can see the discrepancies start at the 50th element of the vector... Yes, the code is still broken. You're returning a pointer to a local variable. The result is that some of your data is trashed when that bit of the stack … | |
Re: My forecast is that you didn't read [URL="http://www.daniweb.com/forums/announcement118-2.html"]this[/URL] on your headlong rush to post as soon as possible. | |
Re: Adding . to your PATH is a terrible idea!. I'm joe hacker, and I've managed to create a short program called 'sl' in your world-writeable temp directory. You lazily come along as root, and mis-spell 'ls' in an attempt to get a directory listing. You box is now mine. Stick … | |
Re: Well if you've got that far, then searching is just a loop over the range of bytes you have, and an if statement looking for the pattern in question. | |
Re: So use Eclipse then. What AD recommended come with a compiler and IDE together, so you're good from the start. Likewise, you could just download them just to use the respective compilers' and carry on using NP++. AFAIK for Eclipse, you have to download and install a compiler as a … | |
Re: > I know my codes has errors which i will fix but if u wanna help me fix them that would be great but in my validating function So how are we supposed to tell the difference between the errors you can fix, and the errors you can't?. That would … | |
The End.