3,183 Posted Topics

Member Avatar for harishjoy

For paths like this, they shouldn't be hardcoded in the first place. Three options come to mind that are viable and reasonably easy to implement: 1. Have the user type in the path. 2. Store paths in a configuration file under the same folder as the executable. Then you can …

Member Avatar for harishjoy
0
288
Member Avatar for nitin1

Try using the -ansi switch. You mentioned Dev-C++ earlier, which suggests MinGW, which I recall was broken in some areas of the stdio library.

Member Avatar for nitin1
0
143
Member Avatar for ulrik m.

You mistyped the code from the book. The format string for double in scanf() is "%lf", with a lower case L, not 1. For printf() it's just "%f". Adding 1 to either of them introduces a field width, which you probably don't want.

Member Avatar for nitin1
0
307
Member Avatar for silvercats

> what is the best boook? The one you have the easiest time understanding. All books will get you started. Some are better from an experts view, but may not be suitable for all beginners because everyone learns differently and understands different explanations of the same concept. It's actually more …

Member Avatar for yxBen
0
1K
Member Avatar for Darth Vader

I don't think 7 seconds is outrageous for almost 13 million runs of that loop. Do you have a reason for increasing the speed or is it just premature optimization?

Member Avatar for tinstaafl
0
1K
Member Avatar for Huxaifa

It seems like you're looking for a [Soundex](http://en.wikipedia.org/wiki/Soundex) type of algorithm.

Member Avatar for deceptikon
0
63
Member Avatar for hala.qaddoumi
Member Avatar for rmbrown09

> What kind of skills / tutorials should I brush up on over the summer to try and gain programming skills that I might need? You'd need an extraordinary amount of talent to pick up programming well enough over a single summer to be at a professional level. Sorry, but …

Member Avatar for rubberman
0
238
Member Avatar for danthegreat

> Can anyone link me to a moderator's profile? need to ask them about something personal. [My profile](http://www.daniweb.com/members/937956/deceptikon).

Member Avatar for deceptikon
0
163
Member Avatar for dangkhoaddt

> To make it even clearer, in the C programming language, nothing in the language keeps track of the size of an array. That information does not exist once the array has been created. You can extract that information, *iff* you have access to the array object itself (a pointer …

Member Avatar for dangkhoaddt
0
202
Member Avatar for xbat

> Admittedly with 951 down voted posts, it appears he/she is doing something wrong Note that the vast majority of those votes were made by a single person. When looking at votes, also look at the unique voters. If the number of votes is high and the number of voters …

Member Avatar for happygeek
0
237
Member Avatar for BigPaw

> Why not get rid of down voting altogether? In reality, and has happened, someone could down vote out of malice, or because they don't know what they are talking about. Any feature can be abused. Should we punish *everyone* for the actions of one or two outliers? Concerning the …

Member Avatar for happygeek
0
168
Member Avatar for rodrigo.l.salazar.14

> <grammar Nazi hat on> "intergers" is correctly spelled "integers". </grammar Nazi hat on> <über pedantic mode> You need to wear your *spelling* Nazi hat because using the correct word in the correct context with incorrect spelling is not a grammatical error, it's a spelling error. </über pedantic mode> :D

Member Avatar for vmanes
0
181
Member Avatar for Reverend Jim

Does the article watch feature not suitably do everything you want? It doesn't bookmark specific posts, but finding the post in an article shouldn't be a problem for all but the ones with many pages. You can also click on the time posted link (at the top left of each …

Member Avatar for Reverend Jim
0
214
Member Avatar for TnTinMN

> If the elapsed time is greater than something reasonable (say 4 weeks) , prompt the current poster to consider making a new thread or even disallow said posts We already put up a notification on the quick reply for older threads, any more than that would be excessive, I …

Member Avatar for TnTinMN
0
211
Member Avatar for JohnMcPherson

Unfortunately this isn't the kind of variation that scanf() is designed to handle gracefully. What's happening is scanf() is detecting the sentinel character before saving any characters for a field, thus an empty field denotes failure to perform the conversion for the scanset. You'll need to check for two adjacent …

Member Avatar for deceptikon
0
957
Member Avatar for kshahnazari

> when I read it how can I find out there was an endline or not ? How do you plan to use that information once you get it? That will somewhat determine what method you use. For example, you can run through the file character by character and look …

Member Avatar for deceptikon
0
113
Member Avatar for Reverend Jim

> Jim you could always try something like http://ideone.com/ to help with the guessing, no clue if it is any good though! It's not up to any serious development, but for quickie test programs it's quite useful. I often use it for PHP because with my dev environment the alternative …

Member Avatar for Reverend Jim
0
229
Member Avatar for london-G

Realistically, a sorted array would be advantageous if you want to get a sorted listing of items, or do a ranged search or anything except an exact match. If all you're doing is searching onesie twosie, the hash table is conceptually faster. In practice the array and a binary search …

Member Avatar for rubberman
0
972
Member Avatar for charles.darwin

Don't reset `upper`, `lower`, and `digit` inside the loop. You only care that *any* character matches, so after it's set to 1, that's a match for the whole string. If none of the characters match then it'll remain 0 regardless.

Member Avatar for charles.darwin
0
160
Member Avatar for bhavna04

> The question states that each candle burns completely in one hour. That doesn't mean that after half an hour the candle is half gone. If the candle is wider at the bottom than the top, it could take 20 minutes to burn through half its height and 40 minutes …

Member Avatar for Reverend Jim
-1
265
Member Avatar for sheikh zohaib

Line 10: Often if the line itself is fine, look at previous lines. In this case you neglected to terminate the previous function prototype with a semicolon. The error wasn't detected until line 10, where it caused the compiler to puke. Line 102: `numemps` is an array, but you compare …

Member Avatar for sheikh zohaib
0
178
Member Avatar for pilotkid424

Most likely what you wanted was this: data[i] = data[i] + m.data[i]; Since the error suggests you don't overload the subscript operator to get the contents of `data`, you need to touch `m`'s copy of `data` directly.

Member Avatar for pilotkid424
0
226
Member Avatar for pars99

Are you talking about just displaying a picture any way that works, or actually rendering the picture using C++? The former is vastly simpler; you can just start the process of a picture viewer and pass in the location of the picture to open it. The latter is quite a …

Member Avatar for deceptikon
0
202
Member Avatar for kinbo

Well, the error says that your query is wrong, so that's a good place to start. ;) My guess would be because Access is having trouble parsing "Tel number", and surrounding it with brackets would fix the problem: string myQuery = "INSERT INTO Parent( Name, Surname, Address, Postcode, [Tel number], …

Member Avatar for deceptikon
0
2K
Member Avatar for haidang.nguyen

> Yup, it works now, with .clear() :). Thanks! As a side note, the reason for that is the status flags of a file stream object are independent of the file that it points to. So if you open a file successfully, read it to EOF, then close it, attempting …

Member Avatar for deceptikon
0
162
Member Avatar for kwm123

> C style strings are pointers to characters Add "sometimes" in there any I'll agree with you. The definition of a string in C is a contiguous sequence of zero or more characters terminated by '\0'. That means you can represent a string with an array (note that arrays are …

Member Avatar for deceptikon
0
117
Member Avatar for Bailey98

> Is it possible to make drivers from scratch in assembly and how easy is it???? Yes, of course it's possible. How easy it is depends on what the driver does, but it's generally a safe assumption that any production quality driver written in assembly wouldn't be described as "easy". …

Member Avatar for deceptikon
0
37
Member Avatar for Lucaci Andrew

> Are we going to get a new Christmas theme for the site? Sounds like a hassle, both technically and in dealing with complaints from people who don't celebrate Christmas and are mad that we didn't come up with a skin just for them. ;) > So it's like good …

Member Avatar for tech-ultrasonic
0
220
Member Avatar for Dewey1040

Could you be a little more specific as to *what* exactly the error is? All I see is code and vague references to "something's wrong".

Member Avatar for Dewey1040
0
120
Member Avatar for vmanes

Well, you could probably go through the minutes of the committee meetings, but I think in this case the rationale is pretty obvious. It's closing an consistency hole in the standard library where there's not an overload for both C-style strings and C++ strings.

Member Avatar for NathanOliver
0
1K
Member Avatar for kingrev

Something like this comes to mind as a first attempt: #include <cstdlib> #include <fstream> #include <iostream> #include <string> int main() { std::ifstream in("test.txt"); if (in) { std::string header; while (getline(in, header)) { if (header.empty()) continue; // Discard empty lines int changes = -1; if (!(in>> changes)) { std::cerr<<"Invalid file format\n"; …

Member Avatar for deceptikon
0
260
Member Avatar for riahc3

http://en.wikipedia.org/wiki/Non-breaking_space A little digging suggests something like `variable.replace(/\xc2\xa0/g, '')` as a solution with the way I assume you're handling encodings. You may need to tweak the code a bit as I'm not super hip with Javascript.

Member Avatar for riahc3
0
235
Member Avatar for harris24
Member Avatar for harris24
0
350
Member Avatar for myk45

> I needed some clarifications w.r.t making functions thread safe. Can you be more specific?

Member Avatar for myk45
0
182
Member Avatar for hg_fs2002

> The reason yours won't compile is because two stars means a 2d array I'd disagree there because it'll cause confusion when trying to assign a 2D array to a pointer to a pointer: int a[2][3]; int **p = a; // Still won't work! The problem is that the type …

Member Avatar for Ancient Dragon
0
102
Member Avatar for steadi

> Is there a way around this? Run each dude in its own thread of execution. Or write Wander() so that it handles steps rather than the whole random wandering that I assume it does. That way you can process one step for each NPC in sequence and it'll appear …

Member Avatar for Lucaci Andrew
0
357
Member Avatar for totalwar235

It means print either doesn't exist entirely or doesn't have a definition. Presumably it's a function, which means you probably declared it but didn't define it.

Member Avatar for totalwar235
0
93
Member Avatar for PrimePackster

> Usually at school, where we use turbo c++ (Horrible) the file could be seen in the folder where the cpp file is saved...... Visual C++ does the same by default. Try running a simpler test: #include <fstream> int main() { std::ofstream out("fooby.txt"); } On my system that program places …

Member Avatar for Ancient Dragon
2
192
Member Avatar for James19142

Are you using multiple inheritance? Off the top of my head I don't recall if the C++ standard requires the base and derived object address to be the same for single inheritance, but it simply *cannot* be for multiple inheritance. There's no way to organize the structure of the object …

Member Avatar for James19142
0
191
Member Avatar for restrictment
Member Avatar for restrictment
0
260
Member Avatar for Ako.si.tootsx

Presumably the language required by your mobile platform. For platforms that support multiple languages, choose the one you're most familiar with. If you're not familiar with any of them, I'd suggest using the one that's most pervasive as it'll be easier to learn and get support on.

Member Avatar for peter_budo
0
57
Member Avatar for jetro57070

Would it be wrong of me to assume that you'd benefit from looking at [an implementation of a standard library function](http://code.google.com/p/c-standard-library/source/browse/src/std/stdlib.c#327) that can handle this? If so, I can shrink it down to the necessities and explain what's going on.

Member Avatar for jetro57070
0
7K
Member Avatar for xbat

> The admins don't seem to really care. I care that you had a hissy fit and I called you on it. I don't care that somebody told you they wouldn't do your project as that's not against the rules. Ignore it if you don't like it, report it if …

Member Avatar for <M/>
0
211
Member Avatar for saurabh.mehta.33234

void foo(void); // Declaration void foo(void); // Declaration (redundant but legal) void foo(void) {} // Definition void foo(void) {} // Definition (redundant and illegal) A function definition is where you give the function a body. A declaration has no body and only lists the function signature (return type, name, and …

Member Avatar for marc.punzirudu
0
163
Member Avatar for saurabh.mehta.33234
Member Avatar for NoUserNameHere

Possible, but not directly. The two options are basically to convert the number to a string and index that, or write a function that separates the number arithmetically and returns the digit at the selected index. Edit: Just for giggles, here's a fun example. :) #include <algorithm> #include <cstdlib> #include …

Member Avatar for NoUserNameHere
0
94
Member Avatar for diya45

SelectedRows won't necessarily be populated from a cell event. You could use SelectedCells[i].OwningRow to get your "selected" row and attached cells: private void dataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { var row = dataGridView1.SelectedCells[0].OwningRow; guest_id.Text = row.Cells[0].Value.ToString(); first_name.Text = row.Cells[1].Value.ToString(); last_name.Text = row.Cells[2].Value.ToString(); txt_gender_status.Text = row.Cells[3].Value.ToString(); txt_martial_status.Text = row.Cells[4].Value.ToString(); phone_numb.Text = row.Cells[5].Value.ToString(); …

Member Avatar for diya45
0
180
Member Avatar for That.T3rr11

At a glance it doesn't seem like the Python code uses anything that's terribly difficult in C#. What parts are you having trouble with? Do you know both Python and C#?

Member Avatar for deceptikon
0
516
Member Avatar for strava

That's kind of an awkward design. Let's say you're hashing integers, you could do something like this (assuming the class works like I think it does): HashTable<int> ht(-1); It says that the hash table will use -1 as the "item not found" marker value. The idea is that the argument …

Member Avatar for deceptikon
0
642

The End.