5,237 Posted Topics
Re: First, unwind that excessive indentation. 12 closing } in a row is just awful. This is how you should do an if / else if / else chain [code] if ( cond ) { } else if ( cond ) { } else if ( cond ) { } else … | |
Re: > char filename[] = ""; This has no space to store an input - instant buffer overflow and broken program. Also, consider using fgets() to read each line, then deal with the line in memory. | |
Re: Have a go at working out an answer, and post your reasoning here. Then we can tell you if your approach is good. Simply telling you the answer won't help you understand why it is (now), or help you in a similar circumstance later. | |
Re: The "problem" is that it is still pseudo-code. > if (ch is an operand) This needs to be turned into real code. | |
Re: Try using a search engine. <spoon> [url]http://ark.intel.com/Product.aspx?id=47663[/url] [url]http://ark.intel.com/Product.aspx?id=43537[/url] </feed> | |
Re: > I hope this is the right place to ask such questions. The Qt forums might be better. Forums such as this typically deal with language issues. When you're deep into some specific oddity of an API, then it's best to check the forums / other support for that API. | |
Re: > ftp = InternetConnect(internet , "127.0.0.1" Why are you trying to upload it to yourself? | |
Re: [url]http://www.daniweb.com/forums/announcement118-2.html[/url] Post an attempt, then we can work out what to tell you to help you learn. | |
Re: Since you're using C++, then[ICODE] std::vector< std::string > lines;[/ICODE] would save you from knowing in advance how many lines there are. Look up the push_back method for vector. | |
Re: > x=(float**) malloc (T*sizeof(float*)); 1. Make sure you're compiling your code with a C compiler (not a C++ compiler). If you're getting warnings about "void* to T*", then you're compiling C++ code. 2. Remove the cast of the return result. It does nothing useful if this really is C code. … | |
Re: strcpy et al are in string.h (missing from your code) | |
Re: s/urgent/yawning [url]http://www.daniweb.com/forums/announcement14-2.html[/url] Try a career in management if all you can think of doing is passing the work on to someone else to do. | |
Re: If you want to see what's happening, then do [ICODE]gcc -v -o hello hello.c[/ICODE] It will print out the full command lines generated for the compiler, assembler and linker. If you really wanted to, you could do the same things yourself. But doing so is highly specific to your current … | |
Re: > I was looking for c++ specific i/o. But there is no *man* page for it like cin/cout. If it isn't cin/cout (or more generally, the C++ streams), then it's nothing to do with C++. For such information, you need to read the additional documentation which comes with your compiler … | |
Re: Well perhaps if you posted YOUR implementation, we might be able to tell you what's going wrong. Or start single stepping the code through the debugger, rather than relying on other people to debug your programs for you. | |
![]() | Re: The short answer is yes. The longer answer is no. > I'm not a student of the computer languages Without some ability to write out the commands you want to perform, it's going to be hard to explain at a distance. > (when no-one's available to set it manually.) Does … ![]() |
Re: > read from an application program like Microsoft excel Do you mean this? Or do you mean read from "excel format" .xls files, and print that? [url]http://www.microsoft.com/interop/docs/officebinaryformats.mspx[/url] Get ready for a long reading session. | |
Re: What exactly does port.read() do? Things I can think of include - it doesn't append a \0, so all your string functions are working on a prayer. - it doesn't do "framing", so if you happen to lose sync with the transmitter, you end up with messages like this > … | |
Re: > base64 algorithm which is used for the encryption of passwords No it isn't. Base64 is just about turning the unprintable into the printable. The data from any 3 random bytes is converted into 4 printable characters. Reversing this (back to 3 bytes) is easy. Then the real challenge begins. | |
Re: > gradeavg[0] = gradetotal[0]/i; I see here you're doing integer division, so you will get truncated answers. If your grade scores are not integers to begin with, then your data types for reading the file are wrong. An example file format would help | |
Re: > It compile but it keeps giving me 0 which is not correct. For what values of n and k? > denominator = denominator *i ; These would have numeric overflow pretty quickly. Add some debug to print each denominator value in the loop. Also show us how you print … | |
Re: Well that depends on what kind of array you have. [url]http://en.wikipedia.org/wiki/RAID[/url] | |
Re: Why not design your images locally in 32-bit mode, then convert them to some other format for publishing. There are a number of different image formats, which allow you to trade quality for size. Pick the one which fits your needs. | |
Re: > For Multi-line comments the lines must be removed not just space filled as it looks way to ugly! And a file full of #line directives isn't ugly? Seriously, is anyone going to READ your post-processed code? Do it in several steps - replace each comment character with a space … | |
Re: Read the documentation for your C compiler. The normal C convention is to pass all arguments on the stack. | |
Re: The cache works better when you HAVE loops, not when you don't. If all you've got is straight-line code, then the very fast processor is essentially bypassing the cache and it is stuck waiting for slow memory to deliver the next instruction. A populated cache on the other hand can … | |
Re: Use %1s if you want to read a single letter (and make the result char aLetter[2]). %c takes the next character without exception. | |
Re: What does gender or geography have to do with your question? [url]http://www.catb.org/~esr/faqs/smart-questions.html#bespecific[/url] > I have to do a very imporant project. Important to who? [url]http://www.catb.org/~esr/faqs/smart-questions.html#urgent[/url] > I have read a book, but just from reading and following those instructions I am not able to key my own tool But if … | |
Re: You have one massive function to do everything. Break your list steps into - initialise list - append to list - print list - destroy list | |
Re: How does your program exit? One of the requirements for getting a gmon.out file is performing a "normal exit", which basically means dropping off the end of main() in the usual manner. If your program just drops dead, then you're not going to get a profile. Practice with some simple … | |
Re: port (for example) is just a local variable inside the function. If you want it to be visible anywhere else, then it needs to be a class member variable. | |
Re: [url]http://cboard.cprogramming.com/cplusplus-programming/125034-access-dynamic-path-folder-ios-ofstream.html[/url] | |
Re: [url]http://clusty.com/search?query=hp+bios+password+reset&sourceid=Mozilla-search[/url] | |
Re: Because one thing (directx) has nothing to do with the other (eclipse). If you're having problems with directx, then you should be reading directx manuals and tutorials, and trying the example code. Finding a new IDE won't fix that at all. | |
Re: > while(!feof(file)) This doesn't do what you think it does. feof() only becomes true when some file reading function (say fscanf has already FAILED). But since you don't check that, you potentially end up with some junk on the last record. Consider this an alternative [code] while( i < 100 … | |
Re: > file.read((char *)&s2,sizeof(s2)); Well scribbling all over the base of your object in the hope that it will land on your class private members is way too much to hope for. You need to arrange proper access to this memory. | |
Re: There was a burst of I/O activity here as well. [url]http://cboard.cprogramming.com/c-programming/124972-when-implementing-cpu-fcfs-algorithm-what-does-process-do-after-i-o-burst.html[/url] | |
Re: The approach is good, but take smaller steps. So instead of [code] while ( *p ) { char c = *p; if ( c >= 'a' && c <= 'z' ) c = c + 'A' - 'a'; *p++ = c; } [/code] Start with looking at the ASM for … | |
Re: [url]http://www.daniweb.com/forums/announcement8-2.html[/url] Which is in response to your [URL="http://www.daniweb.com/forums/thread58984.html"]whining bump[/URL] of this year-old thread. Make an effort, even if it's just printing "welcome to ATM, enter PIN". | |
Re: Well the cleanest thing to do would be to send a "quit" message from the client to the server. The server can then do an orderly shut-down. Instead of spraying machine-gun fire all over the system with your attempts to kill random processes. | |
Re: You need VMS [url]http://www.angelfire.com/mo3/martin0/c/c_intro.html[/url] [quote] The return 0 is important. The zero is the exit status of the program, which can be interrogated by the caller. Zero is guaranteed to indicate success in the operating system being used. On UNIX, 0 indicates success, so no change is made. On DEC … | |
Re: > Console.Write("1"); // --> should not be here Into [code] // Console.Write("1"); // --> isn't here any more! [/code] | |
Re: > I have a wireless camera with RGB (RCA) exit cable (PAL) Posting links to your specific model might help cut out a lot of the guessing on our part. [url]http://en.wikipedia.org/wiki/OpenCV[/url] | |
Re: Good Cop: You've done good to get that far (and you used code tags). It shouldn't be that hard to take the code you've written (and the experience you gained writing it) to make it do something slightly different. Bad Cop: You found the code on the net (or it … | |
Re: Post your latest effort. [url]http://www.daniweb.com/forums/announcement114-2.html[/url] | |
Re: > int det(int); Fix this so it looks like your definition of the function. > int a,k,i,length,[COLOR="Red"]minor[/COLOR][10][10]; Pick a different name - it's the same as your function. | |
Re: > add $t5, $s0, $a0 #address of Buffer[i] in $t5 You're using the same index for both. [ICODE]buffer[j] = buffer[i];[/ICODE] j lags behind i for every non-valid character you come across. Don't forget to put the \0 in the right place when you're done. |
The End.