789 Posted Topics
Re: My grandma has horrible luck with computers, too. She's always had a Mac and I've never had one, so I just claimed I didn't know how to fix them (mostly a true statement anyways). So she consistently takes it to my aunt and uncle, who also have several Macs. Apparently … | |
Re: [quote=iamthwee;316867]Erm, [code=cplusplus]cout << hello cout << hello << " " << hello[/code] Negating the obvious syntax errors can you see how line three has two columns. How weird you say. :lol:[/quote] Did you read his code? It's done that way. :rolleyes: Here's the output I get running it: [code]Data type … | |
Re: The following is copied from the first google result for "c++ int to string": [quote] [B]Q. How do I convert from int to string?[/B] A. Converting from int to string is a little more complicated than converting a string to int. There are no standard C++ functions for this, but … | |
Re: Ancient Dragon's example will work for the first elemend of the 2D vector, and you'll probably have to nest it to go through all the rows of the 2D vector. | |
Re: "programming" or "Computer Science" will not teach you the specifics of an OS unless the CS part deals with it specifically. There's certainly a selection of textbooks on the subject, however, which are likely used in various curricula. Read through one of those if you're dying to know how an … | |
Re: If you're going to use C++ I/O, you might as well use the std::string class rather than a char*. And for reading in a whole line of input at a time, use getline(). For the database itself, a vector would probably be appropriate. You could do something like this (pseudo … | |
Re: The easiest way would probably be to take the input as a string and compare each character to '1' and '0'. This will also help you tell if the user entered something like "101234" or "16oz." | |
Re: [quote=joeprogrammer;310887]It seems like the vast majority (87% at the moment) dislike or can live without this holiday. Funny, isn't it?[/quote] I think it's become another compulsive commercialized scam. For one, it shouldn't take a holiday to tell someone you love them, nor should it take expensive gifts on said holiday. … | |
Re: Not in a simple way. Because things are strongly typed in C/C++, you need to have a single type that can hold your data. You could do something along the lines of this though (pseudocode): [code]class Data {}; class Int : Data {public: int i}; class Char : Data { … | |
Re: I got 1, 3, and an alternate for 6 (Christmas Eve, Christmas, Boxing Day). | |
Re: - not being bound to proprietary hardware - bootcamp having support for >2 OSs (I've heard it doesn't) If it weren't for that, I might buy it :p | |
Re: 95% here, missed #3 (but I hardly ever use high beams, so my answer should have counted :p). I suppose that's a good thing, since I do like to drive... unfortunately my car got totaled the day after Christmas (no injuries thank goodness), and I'm still resolving the insurance claim … | |
Re: ^ is a bitwise XOR operator. It can only be used on primitive integer types. ?: is the ternary operator, so named because it takes three parts (see example below). It's shorthand for an if-else clause. [code] if(condition) foo(); else bar(); // can also be done as: condition ? foo() … | |
Re: I think it's just another scapegoat for people so they don't have to take responsibility for themselves... | |
Re: [quote=jbennet;308906]Ive sorted out the dlls i need for VLC to play WMAs...[/quote] Sorted out the dlls? Why would you need to do that? | |
Re: Holy thread necromancy, Batman! Sorry, just been wanting to use that line for a few days... I guess I don't qualify as an old-timer... *whistles* | |
Re: [quote=~s.o.s~;310033]Google for terms like Sierpinski curve, Knights tour, Travelling salesman problem, Stable Marriage problem and the Eight Queens problem for some applications of recursive problem solving techniques.[/quote] I'd take stable-matching/marriage off that list, since it's much easier to do in a loop. Min-max would be a suitable replacement, however, it … | |
Re: Didn't really look at your code, nor do I intend to, but I'll propose a few methods for breaking out of nested loops: - LIke WaltP suggested, use a variable as a break condition. Check it in your loop condition statement or in an if statement at the end of … | |
Re: What about other operating systems? There's a lot of people 'round here that'll probably prefer a *nix distribution... ;) Oh, and Apple was the first company to coin the term PC. Now that their hardware is basically the same as an "IBM-compatible" PC, you might consider revising your terms :p | |
Re: for the original problems, the answers should be 20 and 256. Since it's a loop, it'll repeat until the condition is false (i.e. until [inlinecode]a>12[/inlinecode] and [inlinecode]a>25[/inlinecode] respectively). | |
Re: [quote=kantze;309747]...but this works fine...[/quote] It shouldn't. Your first code sample should die a fiery death (and it does). It's because when you have code like this: [code]char* c; c = "some string in memory";[/code] you're just changing where the pointer c points to. It really points to some random place … | |
Re: always lived in the same neck of the woods... it be listed in ye olde profile if you can't find it... :p | |
Re: Not till you've understood the [url=http://www.daniweb.com/techtalkforums/announcement9-2.html]forum rules[/url] | |
Re: [code]int row = 0; int col = 0; for (row =0; row<theArray.length; row++) { for(col = 0; col<theArray[row].length; col++) { // no work being done here... // you should compare theArray[row][col] with what you're // searching for and you can return if it's a match } } if (row == … | |
Re: Look through the files for a try-catch block for an IOException and an output message matching what you've shown us. We can't really do much without seeing the code or where the error is coming from. If you have more than one catch block with that message, you can trace … | |
Re: The error would be helpfu for us to help you, but lemme give this crystal ball a try... You never initialize cString, so it's just pointing to some random place in memory. Then you try to read from the file into that place in memory. When that happens, you get … | |
Re: When your code is compiled, it is tailored for a specific environment (e.g. operating system, or certain library support). You can't just create a binary that'll run on anything, anywhere. | |
Re: You probably would be best to look into a threading library and make your program multi-threaded. | |
Re: I recommend that you start with standard C/C++ like joeprogrammer mentioned, and just get used to the language and its constructs. Afterwards you can familiarize yourself with specific libraries if you so desire. | |
Just kinda wondering what distros people have run. I LOLed in the Choosing a Distro forum when people said Gentoo was the hardest distro, so I was wondering what everyone's background is. I've had Gentoo on my laptop since April (exclusively since June) and it's the system I use most … | |
Re: yum is the package manager for Fedora Core, whereas Mepis is .deb based. Try using apt-get or synaptic. [url=http://www.mepis.org/docs/en/index.php/Installing_Software]This page[/url] should cover the basics of installing packages on Mepis | |
Re: You'll want SMP. You might as well get bigmem, though I don't think it's needed for less than 4GB of memory. If you intend on upgrading to 4GB at some point, get it. I don't recall how memory-mapped I/O interferes with the memory space without bigmem... | |
Re: [quote=indienick;304683]There are two branches of programming: functional, and object-oriented. Functional languages leave the entire language at your disposal without having to import other "classes". The problem that arises with functional languages, is that you end up re-typing out code again and again. For instance, let's say you're creating a program … | |
Re: [quote=niek_e;305476]Here's a simple tip for you: By adding [inlinecode] using namespace std; [/inlinecode] to your code, you wouldn't have to type std:: everytime: [inlinecode]cout << "hello";[/inlinecode][/quote] There is also the issue of invoking the entire std namespace and the scoping issues resulting from that, but I s'pose that's for another … | |
Re: First question I have is why are you using doubles when you should probably be using ints? Second question would be why is everything static? Static members belong to the class rather than to a specific object (instance of the class). The way you have it now, all the libraries … | |
Re: We'll certainly help you, but we won't do your work for you. If you have some code that's not working right, post it and we'll try to fix it. If you don't know how to code the solution, tell us what how you think it should be solved and we'll … | |
Re: Once you have the bit string it's pretty easy. You'll just need to loop from the least significant bit (the one whose value is 1, often the right-most one) through the string to the most significant bit (the one whose value is 2^n, corresponding usually to the left-most). If the … | |
Re: You're really close again. You've got the assignment backwards for the first value (it should be [inlinecode]a = theArray[0];[/inlinecode]). There is one other problem with your code though: it doesn't scale. What you posted will rotate the first 10 items, and the loop will cause the rotation to happen however … | |
Re: B(+) trees would be just writing a data structure, which I would imagine would be a little below the scope of your project. However, you could incorporate them into a basic database engine (since that's one of the biggest uses of B-trees). That might be a little over the top, … | |
Re: choco^2, and somewhat accurate. And I agree about the cake brownies sounding wrong, though they wouldn't have been my first choice anyways | |
Re: Maybe I should consider myself lucky that my first impressions of Narue are from her technical posts... that said, I think a great many people, especially on the internet, fail to realize how sheltered and buttered up their lives have been. And if you can't take some [mostly] anonymous criticism … | |
Re: You'll need to be consulting documentation for those. Most of the time, all of those functions will already be compiled into libraries, and your linker will reference the libraries when it puts your program together. | |
Re: Purple Avenger's reply mentions some good points, but fails to describe how pipelining actually works. If you think of a basic (naive) design for a processor, you'll probably have it read an instruction from instructional memory (or cache), parse the instruction, read register values from the register file, send those … | |
Re: From my b-day in July... (and I just couldn't cut the dog in half :eek:) | |
Re: Just noticing a few things (using WaltP's code as a reference): 1) using [inlinecode]sizeof(buffer)[/inlinecode] will not give you the right length since buffer is a pointer, so it'll probably be the same size as an int. You don't want actualMessage to be 4 chars long (assuming an int is 4 … | |
Re: I'm thinking your circular queue is more complicated than it should be. Here's how I would write one: [code] struct circular_queue { someFormOfData** data; int head, tail, count, size; }; void insert(ciruclar_queue* q, someFormOfData* d) { if(count == size) // it's full { growTheQueue(q) } q->data[q->tail++] = d; // add … | |
Re: [quote=Ancient Dragon;297437]never have that problem -- I learned touch typing in HS and have been touch typing every since (probably about 43 years). I think a lot of young people today learn to type on computer keyboards before they are HS age, and consequently learn typing incorrectly -- hunt-and-peck. Typing … |
The End.