789 Posted Topics

Member Avatar for John A

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 …

Member Avatar for jbennet
0
353
Member Avatar for CurtisBridges

[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 …

Member Avatar for Infarction
0
148
Member Avatar for bigben09

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 …

Member Avatar for Infarction
0
115
Member Avatar for tinie

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.

Member Avatar for Narue
0
4K
Member Avatar for mattyd
Member Avatar for jbennet
0
122
Member Avatar for maui_mallard

"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 …

Member Avatar for maui_mallard
0
88
Member Avatar for raydogg57

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 …

Member Avatar for WaltP
0
555
Member Avatar for Matt Tacular

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."

Member Avatar for Matt Tacular
0
82
Member Avatar for mattyd

[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. …

Member Avatar for mattyd
0
291
Member Avatar for Matt Tacular

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 { …

Member Avatar for ~s.o.s~
0
92
Member Avatar for The Dude

I got 1, 3, and an alternate for 6 (Christmas Eve, Christmas, Boxing Day).

Member Avatar for WaltP
0
117
Member Avatar for Lomoco

- 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

Member Avatar for John A
0
96
Member Avatar for The Dude

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 …

Member Avatar for Riv3n
0
182
Member Avatar for kimbokasteniv

^ 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() …

Member Avatar for kimbokasteniv
0
137
Member Avatar for robinayala

I think it's just another scapegoat for people so they don't have to take responsibility for themselves...

Member Avatar for AngelaWest
0
122
Member Avatar for jbennet

[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?

Member Avatar for jbennet
0
161
Member Avatar for Dani

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*

Member Avatar for ~s.o.s~
0
306
Member Avatar for mattyd

[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 …

Member Avatar for Infarction
0
186
Member Avatar for cusado

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 …

Member Avatar for WaltP
0
141
Member Avatar for flaco

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

Member Avatar for jbennet
0
371
Member Avatar for mattyd
Member Avatar for Rickenbacker360

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).

Member Avatar for Nick Evan
0
102
Member Avatar for kantze

[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 …

Member Avatar for Infarction
0
116
Member Avatar for Extremist

always lived in the same neck of the woods... it be listed in ye olde profile if you can't find it... :p

Member Avatar for DemonicGoldfish
0
162
Member Avatar for jlord05

Not till you've understood the [url=http://www.daniweb.com/techtalkforums/announcement9-2.html]forum rules[/url]

Member Avatar for jwenting
0
74
Member Avatar for cassyjack

[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 == …

Member Avatar for Infarction
0
154
Member Avatar for Klitzy

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 …

Member Avatar for mzd12111
0
111
Member Avatar for Firestone

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 …

Member Avatar for John A
0
308
Member Avatar for amirwan

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.

Member Avatar for John A
0
68
Member Avatar for Dqube

You probably would be best to look into a threading library and make your program multi-threaded.

Member Avatar for Infarction
0
71
Member Avatar for Marks256

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.

Member Avatar for WaltP
0
146
Member Avatar for Infarction

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 …

Member Avatar for jbennet
0
117
Member Avatar for Marks256

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

Member Avatar for Marks256
0
101
Member Avatar for jbennet

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...

Member Avatar for jbennet
0
140
Member Avatar for sosina abraha

[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 …

Member Avatar for Infarction
0
271
Member Avatar for Marks256

[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 …

Member Avatar for Nick Evan
0
157
Member Avatar for cassyjack

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 …

Member Avatar for Infarction
0
115
Member Avatar for cpato

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 …

Member Avatar for Nick Evan
0
598
Member Avatar for MBeckford05

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 …

Member Avatar for Infarction
0
85
Member Avatar for cassyjack

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 …

Member Avatar for cassyjack
0
147
Member Avatar for itchap

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, …

Member Avatar for Infarction
0
99
Member Avatar for The Dude

choco^2, and somewhat accurate. And I agree about the cake brownies sounding wrong, though they wouldn't have been my first choice anyways

Member Avatar for Infarction
0
85
Member Avatar for purple rainx

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 …

Member Avatar for Chaky
0
699
Member Avatar for John A
Member Avatar for Aia

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.

Member Avatar for Dave Sinkula
0
256
Member Avatar for mattyd

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 …

Member Avatar for Infarction
0
131
Member Avatar for Erich K
Member Avatar for Extremist
0
730
Member Avatar for bops

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 …

Member Avatar for WaltP
0
281
Member Avatar for Eko

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 …

Member Avatar for Infarction
0
202
Member Avatar for roryt

[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 …

Member Avatar for happygeek
0
242

The End.