5,237 Posted Topics
Re: Behold the magic of indentation. #include <iostream> const int Months = 12; const int Years = 3; int main() { using namespace std; const char * months[Months]= {"Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec"}; int i = 0; int j = 0; int temp = … | |
Re: What are T0IF and RCIF ? Imagine an interrupt control register, with flags for various kinds of interrupts. [code] +---+---+---+---+---+---+---+---+ | | | | | | | | | +---+---+---+---+---+---+---+---+ ^ ^ USART ---+ | TIMER -------+[/code] Setting both to 0 may be fine, if there is only ever one … | |
Re: > you can swap two ints with x^=y^=x^=y; Yeah, and when it isn't an int, then what? [url]http://c-faq.com/expr/xorswapexpr.html[/url] The same old hack gets posted time and time again. If you actually use a temp variable, a modern compiler will typically recognise that it is a swap, and do something sensible. … | |
Re: Well first we need to establish which processor / operating system etc you're using. Because a MIPS answer for Linux won't do you any good if you're using an X86 for Windows. | |
Re: Well [ICODE]\d+\.\d+[/ICODE] would match a single floating point number in non-scientific format. | |
Re: 1. There are copious examples on the net for anyone with the sense to go searching for them. 2. They won't do you any good if you're running your fossil TurboC on a nice new OS like XP or Vista 3. [url]http://clusty.com/search?query=gsm+AT+commands&sourceid=Mozilla-search[/url] | |
Re: Well the first thing you need to remember is arrays start at 0, not 1. 2. Arrays can be initialised, not assigned, eg [code] RF_RXTXPAIR_SETTINGS RF_SETTINGS[2] = { {0xA8,0x2F,0x37,0x50,0xA0,0x00,0x41,0xF6, 0x10,0x02,0x80,0x58,0x48,0x44,0x81,0x0A, 0xFF,0xC0,0x00}, {0xA8,0x2F,0x37,0x50,0xA8,0x00,0x41,0xF6, 0x10,0x02,0x80,0x58,0x48,0x44,0x81,0x0A, 0xFF,0xC0,0x00} }; [/code] | |
Re: Continued here [url]http://www.daniweb.com/forums/post701674.html#post701674[/url] | |
Re: You mean "ANY" browser, or just the usual suspects like Firefox, Opera or IE? | |
Re: Read up on ncurses if you want advanced control of a terminal environment. | |
Re: [url]http://www.catb.org/~esr/faqs/smart-questions.html#writewell[/url] Most of us have got better things to do than to parse large amounts of kiddie/sms speak. This is a forum, not a chat room. | |
Re: [url]http://en.wikipedia.org/wiki/Algorithmics_of_sudoku[/url] Y'know, try using a search engine once in a while. | |
Re: Did you initialise things to 0 before trying to add things? | |
Re: You can have as many awk commands as you like Eg [CODE]awk ' /Exception happened/ { print } /Argument missing/ { print "19878 Static Fixed known error" } { print }' file.txt[/CODE] | |
Re: So nothing in the past few years of study have ever prompted you to think "hey, this would make a great final year project". What, were you just along for the ride and hope the magic piece of paper will guarantee you fame and fortune? Even if we give you … | |
Re: Ah, back to good old DOS days :) [url]http://www.nondot.org/sabre/os/articles[/url] | |
Re: DB DC etc also need to be char* as well. As does your baseAddrTable, it too needs to be an array of char* | |
Re: Rather than mess about with memory allocation (which is just as hard as the real problem you need to answer), start with. [code] const int MAX = 20; void initsquare( int square[][MAX] ) { for ( int r = 0 ; r < MAX ; r++ ) { for ( … | |
Re: > Unfortunately bit shifting is somewhat expensive from a performance stand point. How so? All but the most simplistic processors have these nowadays. [url]http://en.wikipedia.org/wiki/Barrel_shifter[/url] It's even free on some MIPS processors IIRC. As with all code, you should first work on making it right, before worrying about making it fast. … | |
Re: You might also consider that if they insist on using gets() that they really don't know C at all. What they're teaching you is a bunch of non-portable rubbish which is only good for the one compiler they know. It's all very well, but when you come to your next … | |
Re: So it's $1K for the hardware, and $24K for the s/w licences from M$ ;) | |
Re: Ask your [URL="http://www.daniweb.com/forums/thread146908.html"]'friend'[/URL] for help as well. | |
Re: [url]http://clusty.com/search?query=safety+critical+software&sourceid=Mozilla-search[/url] Should take about 10 years to achieve competence. See you around ;) | |
Re: 1. You want to be doing the %2 on the data in each node. 2. You need to be appending the found node to either the odd list or the even list, and NOT returing after the first match. | |
Re: A hint of geography wouldn't hurt either. Like "where in the world are you" and "where are you prepared to travel to". | |
Re: When you hit the segfault, use the "up" command a couple of times so you're looking at this frame #2 0x000171f8 in Compressor::compress () Then list the source code lines so you know exactly where you are. Then start examining variables (in particular, whatever string you're trying to assign) to … | |
Re: > pTemp = nnptr->link->link; This will break if you only have 1 node in the list. > acmetype *head; > inputfn(head); Does input initialise the list? Or is the end of the list whatever junk your uninitialised variable was pointing to. | |
Re: > running the following code with fgets the 162 mb file is read in 8 secs > running with fread it is read in 2 secs. Careful, make sure the second one isn't benefitting from the first one causing information to be cached somewhere. The problem with using fread() for … | |
Re: Or without casts and tricky subscript maths [code] char (*st2)[133] = new char[st.size()][133]; for(int i = 0; i < st.size(); i++) strcpy(st2[i], st[i].c_str()); fn(st2, st.size()); [/code] | |
Re: If you have [ICODE]>file[/ICODE] to redirect stdout to a file, then adding this to the command line [ICODE]2>&1[/ICODE] will also redirect stderr to the file as well. | |
Re: > what is ISO C++ forbids comparison between pointer and integer? Or ISO C++ forbids comparison between elephant and battle ship. The fact that both are large, grey and heavy doesn't mean that they are in any way the same thing. In the same way that pointers and integers are … | |
Re: How are you reading the files? Because "ÿ" is char 255, which is the same (typically) as (char)EOF That is, you reached the end of the file, but did not detect EOF properly, but instead cast it to a char. | |
Re: [url]http://www.daniweb.com/forums/announcement114-2.html[/url] [url]http://www.catb.org/~esr/faqs/smart-questions.html#urgent[/url] How about beginning with putting "Gauss-Seidel" into a search engine, and doing some reading. | |
Re: How is that any different from calling [ICODE]fgets(buffer, sizeof buffer, stdin )[/ICODE] | |
Re: string.length() perhaps? Guessing you really are using C++ properly, and using std::string, and not say char arrays from C. | |
Re: Have you tried other memory cards in your PC? Have you tried your memory card in another PC? | |
Re: "Higher language Vs. Assembly language. " That's the title of a thread on this forum. Which is basically what you just asked. | |
Re: Since you said "mobile", I take it we can't assume that you're talking about a windows desktop environment. In other words, be specific! | |
Re: Gotta love the internet, you should try it sometime. [url]http://biometrics.cse.msu.edu/fingerprint.html[/url] | |
Re: [url]http://www.rocketaware.com/man/man2/rename.2.htm[/url] IIRC, the MacOS is a POSIX compliant OS (or close enough anyway) that functions like this should be available to you as well | |
Re: First off, which "shell" are you talking about? There are many varieties (sh, bash, ksh, csh) and syntax varies. Maybe [ICODE]for i in `cat list`; do tail -21 $i; done[/ICODE] | |
Re: [url]http://www.daniweb.com/forums/announcement61-2.html[/url] At least demonstrate that you've a) searched the web b) copy/pasted any example code into your c# project. | |
Re: Get several sheets of paper, write one letter of a word on each one. "push" the letters onto a "stack" Then figure out how to get the letters back in reverse order to print them. | |
Re: > system("A"); You may be in luck. Some implementations do the right thing with [ICODE]result = system("A");[/ICODE] The POSIX way would be to use fork(), execl() and wait(), something like [code] if ( fork() == 0 ) { execl() // run A } else { wait() // wait for A, … | |
Re: Your array has no size. My guess, it just trashes memory when you fill the first 10 non-existent slots. | |
Re: [ICODE]ls -1rt | tail[/ICODE] Newest 10 files in a directory | |
Re: Which operating system? Which compiler? What sort of program - console, GUI, other? | |
Re: If you run the code in the debugger, wait for the assert, then use the stack trace to track back to your code, it should help you figure out the problem. | |
Re: So what's our benefit in solving your homework? You do know that the whole array is sorted right? |
The End.