5,237 Posted Topics
Re: [CODE]if ( something != -1 ) { // do something } [/CODE] No? | |
Re: > Last edited by Nick Evan; 2 Hours Ago at 14:06. Reason: Added code-tags. Time to stop apologizing and start learning how to use them Shame it still looks an awful mess then ;) In other news... [url]http://forums.devshed.com/c-programming-42/please-help-679306.html[/url] | |
Re: Of course, but it helps if you've learnt to [URL="http://www.daniweb.com/forums/thread78060.html"]read [/URL]to start with :icon_rolleyes: | |
Re: A virtual machine perhaps? [url]http://en.wikipedia.org/wiki/Dosbox[/url] There are plenty about, one should suit your purpose. | |
Re: > But can you please give me any other idea which is more involved and a bit high in degree of difficulty? And thus the Goldilocks problem is revealed, and why it is futile to ever attempt getting involved in "plz suggest a project" threads. Any answer we come up … | |
Re: Well what kind of output did you generate? Was it a COM file or an EXE file? What memory model? probably some other questions I can't be bothered to think about at the moment.... > Can anybody shed some light on the situation? [URL="http://www.catb.org/~esr/faqs/smart-questions.html#prune"]Sure, no problemo[/URL] | |
Re: > if (s[i] == 'a'||'A'||'e'||'E'||'i'||'I'||'o'||'O'||'u'||'U') You need to say [ICODE]if ( s[i] == 'a' || s[i] == 'A' ||[/ICODE] I'm sure you get the idea. | |
Re: > I am trying to convert this C code to C++. So rewrite it then. What you have at the moment is C/C++ road-kill. If you really want to make a good C++ program out of this, then you would be using [ICODE]std::string[/ICODE] in place of all those char arrays, … | |
Re: So stop wasting your time and use a std::string instead. > Does anyone know why this is happening? How many char* pointers do you actually ALLOCATE? Is it four? | |
Re: [url]http://sourceforge.net/apps/mediawiki/cpwiki/index.php?title=Feof[/url] feof() is a state - of a past event, not a prediction of a future event. You need to look at the result returned by the function actually reading the file to determine the success or otherwise. | |
Re: [ICODE]p_bIsolated != 0[/ICODE] would seem to be a lot less obscure, whilst meaning about the same thing to the compiler. | |
Re: We need you to read this: [url]http://www.daniweb.com/forums/announcement14-2.html[/url] That means actually read it, don't simulate reading it. | |
Re: First, you need a better approach to indentation. [code=c] /* File: account.c * * Date: February 2, 2010 */ /* This program calculates the accumulated value of a given initial investment and annual interest, given the options of either annual, monthly, or daily * compounding */ #include <stdio.h> /* Function … | |
Re: Well for 10 lines of code, the indentation sucks. Is the rest of your code an unreadable mess? Do you get any warnings when you compile? [code] $ gcc -W -Wall -O2 -c foo.c foo.c:5:14: warning: multi-character character constant foo.c: In function ‘error’: foo.c:5: warning: comparison is always true due … | |
Re: [code] $ g++ -W -Wall -O2 -c foo.cpp foo.cpp: In function ‘void rotateEncrypt(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, int)’: foo.cpp:21: warning: suggest braces around [COLOR="Red"][B]empty body[/B][/COLOR] in an ‘if’ statement [/code] Of course, you could have … | |
Re: A better question is what of any use are you going to learn from this teacher stuck in the stone age? You already seem to know more than they do. All those ifdef's are messy!!! [code] // screen.h void ColorPrint (const int ColTxtnum,const char *text); // screen_borland.c #include <conio.h> #include … | |
Re: +18? You're not even close! [url]http://www.tomshardware.com/reviews/5-ghz-project,731.html[/url] However, one core stuck at a specific temperature doesn't look good. Can you see it doing things in task manager -> performance (select 1 graph per CPU)? | |
| |
Re: Or, since you appear to be using C++, use std::getline and std::string instead of those messy C-style char arrays. | |
Re: [url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url] | |
Re: Faster than you can read this, that's for sure. [url]http://www.daniweb.com/forums/announcement8-2.html[/url] | |
Re: > MessageBox(NULL, (LPCTSTR)"Test1", (LPCTSTR)"Test1", MB_OK); Indiscriminate casting to get the compiler to STFU is a common problem. Just because you muffled the compiler doesn't make your code good. Take out the casts, then pay really close attention to the error messages. [url]http://msdn.microsoft.com/en-us/library/c426s321%28VS.71%29.aspx[/url] | |
Re: Try this [url]http://www.manpagez.com/man/2/getrusage/[/url] | |
Re: [url]http://sourceforge.net/apps/mediawiki/cpwiki/index.php?title=Pause_console[/url] | |
Re: Posting on the C forum might be a good start. As would posting more than "help" as the body of your text. | |
![]() | Re: [url]http://en.wikipedia.org/wiki/Frequency_analysis[/url] ![]() |
Re: [URL="http://www.zytek.com/traceroute.man.html"]Yes or no?[/URL] | |
Re: [url]http://en.wikipedia.org/wiki/Laser_printer[/url] [url]http://en.wikipedia.org/wiki/Inkjet_printer[/url] > Which one is better among this two? Well that depends on your definition of better. Depending on what you value, "up front cost" and "cartridge cost" may give you different answers. Only you know what your priorities are... > Can any one help me? [URL="http://www.catb.org/~esr/faqs/smart-questions.html#prune"]Maybe[/URL] | |
Re: Or not even use a regex at all. The key here is make a decent design to begin with, then you should be able to swap in and out different implementation ideas later on without having to rewrite the whole thing. Use whatever you're most comfortable with, just so you … | |
Re: More cross-border postage.... [url]http://cboard.cprogramming.com/c-programming/123692-ports-c-lanuage-microsoft-visual-cplusplus.html[/url] | |
Re: Did you tell the linker - where to find the axutil library - to actually use the axutil library. The #include in your source code just tells the compiler that something exists (like say cout). But you also need a library for the actual implementation, and that's where the linker … | |
Re: It's a pretty sure thing that you're looking at the effect rather than the cause. Something else is probably trashing memory. Here is just where you first notice there is a problem. In a correct program, there is no apparent difference between debug and release (except speed). That you are … | |
Re: Well right at the start Huffman::Huffman end is uninitialised. Then later on... [CODE] long begin,end; begin = output.tellg(); output.seekg (0, ios::end); end = output.tellg(); [/CODE] This local variable shadows your member variable, and you're still out of luck. | |
Re: Isn't this a question best asked of your local careers advisory service? | |
Re: Well you could try indenting your code. The last return 0; seems WAY WAY out of place... | |
![]() | |
Re: Just use the find command - this is bread and butter for find. [code] $ find work -daystart -mtime -1 -size +2000c -ls 327592 4 drwxr-xr-x 2 forum forum 4096 Feb 17 16:18 work 327419 12 -rwxr-xr-x 1 forum forum 9339 Feb 17 16:18 work/a.out $ find work -daystart -mtime … | |
Re: You need to strip the newline off the end - did you notice the line break in the invalid option? Try [ICODE]str = strtok(NULL, " \n");[/ICODE] | |
Re: [url]http://www.opengroup.org/onlinepubs/009695399/functions/fdopen.html[/url] Use this to associate a file descriptor with a stream. | |
Re: You're still writing bits, even if you write a file. Also, you can't just change one bit of a disk. The minimum addressable amount is typically 512 bytes (at the disk level). The file system usually aggregates these into single units called clusters - who's size can be anything from … | |
Re: scanf() is hard to use at the best of times. %c just makes it horrible in the extreme. Any random space on the input will screw you up. [ICODE]fgets( buff, sizeof buff, stdin ); sscanf( buff, "%c%d", &myChar, &myInt );[/ICODE] | |
Re: Does this help? [url]http://support.microsoft.com/kb/314063[/url] | |
Re: Well why aren't YOU looking around the VLC website, the VLC code base and the VLC forums, instead of trying to get us to do your reading for you. We could spend hours or days trying to figure out what you want, only for you to dismiss it in a … | |
Re: According to [URL="http://www.hkinventory.com/p/d/216TQA6AVA12FG.htm"]this site[/URL], the package is a [URL="http://en.wikipedia.org/wiki/Ball_grid_array"]Ball_grid_array(BGA)[/URL] Removing the old one will be hard. Getting the new one properly attached will be harder still - one screwup will likely end up frying some other stuff as well. Personally, I would cut my loss and sell what is usable … | |
Re: > what's mean #include in c language [URL="http://www.cppreference.com/wiki/preprocessor/include"]#include <std_google_search.h>[/URL] You really need to watch the post dates, before you leap onto the end of any existing thread, based solely on the similarity with your own question. | |
Re: [url]http://sourceforge.net/apps/mediawiki/cpwiki/index.php?title=Indentation[/url] Your code is awful to look at. While you're there, look up void main as well. | |
Re: > Is there a more efficient way 2 do it? Well there are no simple ways of doing it more efficiently. Also, if your input file contains no characters, how many characters are you writing to the output file? | |
Re: But a recursive function in C++ would be no different to a recursive function in Java. There is no C++ magic here, almost every language can manage recursion. But if you don't understand the need for a stop condition (as Dave points out in post #4), then you're stuck anyway. … | |
Re: #IND is for indefinite. You may also see #NAN and #INF from time to time as well. All basically mean the same thing, and that is your calculations were way off (possibly the result of garbage data). Here's a nice short intro to all the different things floats can represent. … |
The End.