5,237 Posted Topics
Re: If you've got variable types, then write out some kind of 'id' first, so that you know what kind of object is next in the file. Similarly for variable lengths, write out the length, then the data. | |
Re: You also forgot to read these as well [url]http://www.daniweb.com/forums/announcement118-2.html[/url] [url]http://www.daniweb.com/forums/thread78060.html[/url] Now, which bit are you really stuck on? | |
Re: > My Question is why is there an extra gap of 3 in the memory? Because things like int or floats are more efficiently accessed (or even only possibly accessible) if they're on say a 4 byte boundary (or even 8 bytes for doubles on some machines). | |
Re: I've got to ask why you feel the need to do this... | |
Re: Dead easy in awk (Perl's baby sibling) Assuming these are comma separated value files, [ICODE]awk -F, '{ print $1 "," $6-$10 }' file.txt[/ICODE] | |
Re: 4. As option 1, but edit the tasm.cfg file (or whatever it's called) which sets environment variables for LIB and INCLUDE. These are the default places it searches for things. Simply add the 3rd party directories and you can use them for anything without any further (or extra) effort. | |
Re: > Data = new string[size]; Not only does this leak memory, it also loses all your previous input. You need a way of expanding your array of lines. Have you considered that std::vector would be ideal for this. Put the cin.ignore directly after any I/O functions which leave newlines behind. | |
Re: I see an = where there should be an == What compiler, and what warning level are you at? | |
Re: > Can anyone please tell me where is the printed output go? In this example, it would go to the console. In debug, it would expand to printf ("This is the debug output\n"); It would be pretty easy to replace that with say [ICODE]void myLoggingPrintf( const char *fmt, ... );[/ICODE] … | |
Re: > 1) I have a list of logins, seperated by a space (in a logins.txt file, like so: login1 login2 login3). All on one line? Or like login1 login2 login3 login5 login5 You could try this [code] for i in `cat logins.txt`; do grep $i online.txt; done [/code] For the … | |
Re: What if one of the laptops was on your desk, and the other laptop was on your robot? Something your "dual core" processor could never do. | |
Re: What version(s) of QT are on the machines which work? Why do the same directories repeat over and over in the compiler command line? If you do a search of /usr/local/Trolltech/Qt-4.4.0/include, do any of those files contain QCoreXmlStreamWriter? If they do, check to see if such references are inside #ifdef … | |
Re: Filenames with spaces need quotes [ICODE]TYPE [COLOR="Red"][B]"[/B][/COLOR]C:\Documents and Settings\Owner\My Documents\Log.txt[COLOR="Red"][B]"[/B] [/COLOR][/ICODE] | |
Re: > Career opportunities Hard to pin down now, nevermind in several years time when you graduate. > average pay of specific computer science fields Again, depends where you are and what's flavour of the month when you need to start looking. What's hot today could be well out of date … | |
Re: Any particular "brand" of "unix"? An awful lot of things claim to be "unix", even many things which only look like "unix". | |
Re: > outfile << "\n\nThe following string was checked for being a palindrome:" So why don't you print data (your input array) rather than messing with 20+ lines of stack pushing and popping? If your argument is that it may have unwanted characters, then consider another function to "clean" the line, … | |
Re: What's wrong with using the proper API to remove a file? Like say [ICODE]unlink( "C:\\users\\robocop\\desktop\\a b c.txt" ); remove( "C:\\users\\robocop\\desktop\\a b c.txt" ); [/ICODE] Neither of which require you to guess how many times you need to escape \" or whatever to get the command interpreter to do what you … | |
Re: Well how well do you actually know Java? Knowing a bunch of easy answers might seem like a good idea, and may occasionally get you the job. Keeping the job on the other hand will require you to actually know your stuff, and not just have a good short-term memory … | |
Re: > 2: Open Project/solutions-settings and add the include and library-folders to the list. You also need to add the library name(s) as well to the list of additional libraries (also on the linker settings somewhere). | |
Re: [quote=first search engine result] "This directory contains the source code and shell scripts necessary to convert SEGY files to ASCII format and to create postscript plots, along with a makefile and a README file."[/quote] I found that with an obvious web search. Is it what you want? Can you guess … | |
Re: > while (!myfile.eof()) [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046476070&id=1043284351[/url] Use [ICODE]while ( getline(myfile, line) )[/ICODE] Try it with a small text file (say 5 lines) and note the difference. | |
Re: Wow, a 4 year bump, and the answer is still the same? Did the bumper bother to read anything, or just attach the same question based on the result of a feeble search? | |
Re: [url]http://www.nondot.org/sabre/os/articles[/url] (down just at this moment). There's a whole section of various file systems. | |
Re: Getting people to use code tags on Daniweb :P | |
Re: You missed this on your way in [B][URL="http://www.daniweb.com/forums/announcement8-2.html"]We only give homework help to those who show effort[/URL] [/B] | |
Re: > My friend basically did it all for me. Well there's your problem. Unless you do all the work, AND make damn sure you understand all the reasons why you did everything ("I guessed and it worked" doesn't count), then you're doomed to fail from the moment you get someone … | |
Re: Function pointers need more ( ) [ICODE]vector<bool(*)(int x)> rules;[/ICODE] | |
Re: Well that would depend on how "string" is declared in your C program. | |
Re: Without seeing some source code, there's not a lot we can do except admire your artwork. | |
Re: Nevermind the database, you need to work on the basics of C programming. > int main([COLOR="Red"][B]([/B][/COLOR]int argc, char *argv[]){ Mis-matched. You didn't even compile this before posting did you. > fflush(stdin); [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1052863818&id=1043284351[/url] > gets(opt_host_name); [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1049157810&id=1043284351[/url] Not only that, where is opt_host_name pointing? Answer - nowhere. Practice reading input using char … | |
In the blurb to encourage guests to sign up, there's this line. "[COLOR="Red"]In fact, there are 4,267 IT professionals currently interacting right now![/COLOR]" Nope, not by a long shot. I bet a lot of people think "[COLOR="Green"]Wow, must be a great place, I'm sure to get my question answered here … ![]() | |
Re: [URL="http://sourceforge.net/projects/dban/"]Darik's Boot and Nuke ("DBAN") is a self-contained boot floppy that securely wipes the hard disks of most computers. DBAN is appropriate for bulk or emergency data destruction.[/URL] How long did you let it run for before you realised your mistake? | |
Re: General comments: 1. The indentation needs work. 2. Lower level functions should just return results. Maybe I just want to search, WITHOUT print the result AND clear the screen. > void random(int []); Well named variables in the prototype will help document the API. What we've learnt so far is … | |
Re: > Last edited by LiquidScorpio81 : 43 Minutes Ago at 18:45. It's a shame you didn't add the code tags. "Hey, I know, lets piss off all the people who help around here by continually posting unindented crap." Doesn't work kiddo. Either we ignore you, or just report the post … | |
Re: Do you have to do it in C? Because it's like a 5 minute job and a handful of lines of code in say Perl. | |
Re: Rule 1 - don't spam the crap out of the net with your cross posting [url]http://www.catb.org/~esr/faqs/smart-questions.html#forum[/url] Already answered here - [url]http://cboard.cprogramming.com/showthread.php?t=106619[/url] If a forum doesn't deliver, then you're free to move on. Broadcast spam like this just pisses people off. Rule 2 - read ALL (not as in your case, … | |
Re: <vader>I sense a [URL="http://www.daniweb.com/forums/thread142501.html"]presence on the forum[/URL], which I've not sensed since.....</vader> > Generate a set of test inputs and expected results for the Currency Conversion program. Starting with an example "good" input and some examples of bad input (you ask for an integer, you type in "hello" say). | |
Re: Do you have a specific test case? Are you sure it's not something like 1234567 being displayed as say 1.23456E6 (for example). | |
![]() | |
Re: > int ar[100]; But if you write the code [URL="http://www.talklikeapirateday.com/wordpress/"]on this day[/URL], it would be [ICODE]int arrrrrr[100];[/ICODE] | |
Re: I assume you're talking about plugging a device into a standard desktop machine running say Linux or MacOS, and you want to record when the user logs off the desktop machine. This is a pretty good hardware site. [url]http://www.lvr.com/[/url] | |
Re: > 1B 5B 33 67 = ESCAPE [ 3 g > 1B 48 = ESCAPE H [url]http://clusty.com/search?query=escape+sequence+ANSI&sourceid=Mozilla-search[/url] And an ASCII table if you can't do that stuff in your head yet. I'm guessing your "cd /home/user" is an alias for something which outputs a bunch of escape sequences and then … | |
Re: A couple of things. 1. VC6 is probably 10 years older than your Linux compiler. 2. Have you considered using [URL="http://www.sgi.com/tech/stl/Vector.html"]reserve()[/URL] to allocate all the space up front, then just subscript your accesses (rather than push_back) | |
Re: Well the last line would (probably) launch Excel on a machine where Excel was installed, and all the file associations were set up correctly. Other than that, your analysis is good. | |
Re: Yes, faster to the first bug than almost any other language. #include <std_troll.h> | |
Re: [ICODE]#define _CRT_SECURE_NO_WARNINGS[/ICODE] Put this at the very start of your program - the first line in fact. > error C2087: 'numbers' : missing subscript > void getArray (int numbers[][]); You're only allowed to leave the left-most one empty. All the other subscripts need a size. > space[x][y] = false; What … | |
Re: > Alas, I have no time to inspect your code more carefully now. Take your time, it was posted (and abandoned) on 8th Jan 2005 | |
Re: Looks perfect to me, what's the question? I should say, what's the requirement. Because without that, the post is meaningless. I mean, I could guess this is a currency conversion program (in which case, it's pretty good). But if it's for a game of chess, then it's rubbish. Consistency perhaps? … |
The End.