279 Posted Topics

Member Avatar for nexocentric

vbapi is no longer supported. Your article actually says so, but not very clearly (just under the article title, to the left). Try [url=http://support.microsoft.com/kb/187912]this article[/url] instead. [url=http://support.microsoft.com/kb/205277]This one[/url] might be even newer/better.

Member Avatar for nexocentric
0
194
Member Avatar for JAGgededgeOB172

Here's a parital fix. I fixed a couple of problems (noted in comments), and a couple of stylistic things in your first two functions. I didn't even look at the other functions, but it works better. It seems to still be missing one name. [code] int main() { ifstream fin …

Member Avatar for nucleon
0
176
Member Avatar for Philmagrill

OP> [b]How do i get it to parse the ":" and just leave the word sunny[/b] [code] /* This assumes there are no other colons or commas before the ones you want. */ char word[MAX_WORD]; char *pColon, *pComma; pColon = strchr (string, ':'); if (!pColon) { /* No colon found; …

Member Avatar for jephthah
0
109
Member Avatar for bemo55

Your main problem is that you need to do the sscanf before you do the strtok(NULL,"..."). Couple other problems: no use passing in txt to use as local variable; return type doesn't match what you're trying to return; renamed a couple variables. And I changed sscanf to strcpy; but sscanf …

Member Avatar for jephthah
0
228
Member Avatar for death_oclock

Do you still get the error if you remove: * the file stuff? (replace it with a single buf load to tokenize) * the token stuff? Post a single file minimal version that recreates the error.

Member Avatar for death_oclock
0
194
Member Avatar for kelechi96

You shouldn't really "BUMP" a post. At least pretend to ask another question! regex is something you can look up yourself, but it is not necessary for your problem. Here's an example of parsing a simple config file: [code] /* File config.txt: num = 123 str = hello flt = …

Member Avatar for jen140
0
14K
Member Avatar for SmokyMo

You could be missing headers. But also, you need to use the c_str() member of a string to open a file. [code] #include <iostream> #include <fstream> #include <string> using namespace std; int main () { string flight; cin >> flight; flight = flight + ".txt"; ofstream myfile; myfile.open (flight.c_str()); myfile …

Member Avatar for tux4life
0
90
Member Avatar for kelechi96

[QUOTE=unbeatable0;848183]Another thing is that string::search() returns string::npos if the search function does not find what it was told to find, and not -1[/QUOTE] This is an interesting point. I notice in the standard, clause 21.3 (Class template basic_string), paragraph 6, it does say that: [icode]static const size_type npos = -1;[/icode] …

Member Avatar for kelechi96
0
170
Member Avatar for amegahed3
Member Avatar for amegahed3
0
136
Member Avatar for thornside

[icode]in.ignore()[/icode] is reading another character and ignoring it. Replace [icode]in.ignore();[/icode] with [icode]continue;[/icode] to "ignore" the current character in n.

Member Avatar for tux4life
0
114
Member Avatar for Clockowl

So you are wanting to read a board created by another program. You want to read a screen capture of it? How many different pieces in mahjong? If the pieces are different enough and there's not too many, you could probably figure out something simple.

Member Avatar for tux4life
0
185
Member Avatar for jlanglopez
Member Avatar for jlanglopez
0
88
Member Avatar for rEhSi_123

Just put some spaces or tabs, that is, \t characters at the beginning of the menu lines.

Member Avatar for rEhSi_123
0
118
Member Avatar for BruenorBH

Try changing the relevant part of the rc file to this: [code] CONTROL "Eastern Time", IDC_EASTERN_SELECT, "button", BS_AUTORADIOBUTTON | WS_GROUP, 40, 80, 100, 8 CONTROL "UK Time", IDC_UK_SELECT, "button", BS_AUTORADIOBUTTON, 40, 100, 100, 8 CONTROL "HK Time", IDC_HK_SELECT, "button", BS_AUTORADIOBUTTON, 40, 120, 100, 8 [/code] Set the initial radio button …

Member Avatar for BruenorBH
0
312
Member Avatar for guest7

Your stack trace clearly shows the string allocator blowing up. But how is that possible? Sadly anything is possible with undefined behavior. You could zip your source and attach it.

Member Avatar for nucleon
0
240
Member Avatar for ammonation42

Code is not supposed to look like that. A single function should not span page after page. You've managed to produce structured spaghetti code, with meatballs. (I don't even know what that means.) :) Divide it up into more pieces. More objects, or at least more functions. If something seems …

Member Avatar for jephthah
0
98
Member Avatar for danishamman
Member Avatar for jephthah
0
229
Member Avatar for soulbee1

Here's a simple shuffle that ensures every element is moved at least once. Note the loop only needs 13 reps for 13 numbers. [code] const int MAX = 13; int a[MAX]; for (int i = 0; i < MAX; ++i) a[i] = i; for (int i = 0; i < …

Member Avatar for nucleon
0
731
Member Avatar for Clockowl

I believe you do in fact catch the exception as it is "going on". And since you can catch different exception types, you can tell which is which. Here's a simplified version of loadFile. More ... stringy. Less ... errory. [code] #include <iostream> #include <fstream> #include <string> #include <stdexcept> std::string …

Member Avatar for Clockowl
0
107
Member Avatar for alanng.net

This is old school indeed: [code] int set_keysig (s, ks, init) char s[]; struct KEYSTR *ks; int init; { /* function body */ } [/code] Should be updated to: [code] int set_keysig (char s[], struct KEYSTR *ks, int init) { /* function body */ } [/code] Other than that (and …

Member Avatar for alanng.net
0
124
Member Avatar for JohnKeays

I suppose the canonical example is the example at the bottom of [url=http://msdn.microsoft.com/en-us/library/0wwk06hc.aspx]CWnd::OnCtlColor[/url] on MSDN.

Member Avatar for nucleon
0
89
Member Avatar for vishy_85

To set up a handful of records, perhaps for a little hard-coded testing, you can, of course, do this: [code] // Initializing first 3 fields of first 2 records singleIMEI a[30] = {{"00","01","02"}, {"10","11","12"}}; [/code]

Member Avatar for Ancient Dragon
0
1K
Member Avatar for lancevo3

And you haven't said what the format of the line is. There are two common possibilities: a fixed-length format and a delimited format. A fixed-length is like this: name0---addr0---phone0---info0-----pay0--- name1---addr1---phone1---info1-----pay1--- name2---addr2---phone2---info2-----pay2--- (As long as you're only accessing it sequentially, the last field could actually be variable length since the end-of-line …

Member Avatar for nucleon
0
112
Member Avatar for jam7cacci
Member Avatar for jam7cacci
0
107
Member Avatar for kelechi96

[QUOTE=Ancient Dragon;844662]its a poorly written program. ... line.find() doesn't return -1, it returns string::npos.[/QUOTE] Yeah, it's a pretty rickety structure, I must admit. :( I suppose that's just another reason not to post "solutions" since the kind of thing you whip up in five minutes is likely to be error-prone …

Member Avatar for Ancient Dragon
0
141
Member Avatar for guest7
Member Avatar for sautap4u

What are you doing with words like [i]a, the, on, and, it[/i], etc. They would seem to contribute an inordinate amount to the score and yet nothing to a sentence's "importance". It's possible they just average out, I guess. Or maybe you could have an ignore list of the so-called …

Member Avatar for nucleon
0
112
Member Avatar for Usura

You kids and your string toking! Firstly, if your filename is actually "lines.txt" (as you say at the bottom of your post) then that's probably the filename you should use in your program. :) And you should test the stream like this: [icode] while (ins >> line)[/icode]

Member Avatar for Clockowl
0
115
Member Avatar for want_to_code

I find it useful on occasion to place a prototype in a function. (pssssssssssss)

Member Avatar for Aia
0
174
Member Avatar for Clockowl

> How else can they be different? Yep, they must be the same function. It works if you pick a specific copy like this: [icode] mycar.racer::cruise(50);[/icode] or this [icode] mycar.tank::cruise(50);[/icode] But "diamond inheritance" looks like something to avoid in general. Seems strange that the language wasn't designed to include only …

Member Avatar for stephen.id
1
246
Member Avatar for metal_butterfly

I'm not a socket-head, but since no one has helped you yet, I'll point out a couple of things. If you want help from others, I suggest you give more detail about what it is doing wrong. This method of turning a number into a string will only work if …

Member Avatar for metal_butterfly
0
112
Member Avatar for Laik

How much of your OS is finished? If you're asking about the GUI you must at least have finished the kernel and a command-line interface. Will your OS have virtual memory? Multitasking? Obviously it must have a file system. Are you writing the device drivers yourself, too? Quite a project …

Member Avatar for adam1122
0
127
Member Avatar for xcr

The "download" link somehow added backslashes before every single and double-quote. I notice that you have no increment of the iterator in write_out. Add a ++itr before the end-brace of the while-loop. If that doesn't fix the problem, can you be more specific? How would we recreate the problem? [edit] …

Member Avatar for xcr
0
145
Member Avatar for badboizEnt

It would also be nice if it worked. Did you test it fully? Try entering an incorrect password followed by the correct password. Also, terminate and terminator are confusing names. How about triesUsername and triesPassword ?

Member Avatar for ajay.krish123
0
130
Member Avatar for Aelphaeis

Your dream of [code] char string[15]; string = getstring(15); [/code] will not work. You either have to do this (and why not?) [code] getstring (string,15); [/code] Or this [code] char *string; string = getstring(); // getstring allocates string storage // use string free (string); [/code]

Member Avatar for jephthah
0
91
Member Avatar for Dewey1040

In equal(), declare L1 and L2 as NODE*, not node. C does not generally support bool (use int). TRUE and FALSE need to be declared, or just use 1 and 0. (Or perhaps your version of C supports bool, in which case you mean true and false, not TRUE and …

Member Avatar for Dewey1040
0
86
Member Avatar for shasha821110
Member Avatar for tux4life
0
162
Member Avatar for iTsweetie

You're defining your array with a size of zero. (ARRAYSIZE is 0.) And even if you fix that, your code often refers to listitem[size], which is outside the array bounds.

Member Avatar for nucleon
0
181
Member Avatar for kevintse

Try something like [url=http://msdn.microsoft.com/en-us/library/dd144938(VS.85).aspx]GetTextExtentPoint32[/url] or one of it's cousins.

Member Avatar for nucleon
0
103
Member Avatar for Dewey1040

You need to use the prefix form of ++ and --. So: [icode]return( add( ++n, --m ) ) ;[/icode]

Member Avatar for Dewey1040
0
73
Member Avatar for shasha821110
Member Avatar for kyosuke0
Member Avatar for Duoas
0
130
Member Avatar for f.ben.isaac

"Please criticize my code." My favorite question! :) The biggest problem is that your variable names are too long. "Descriptive" does not mean "long". Here are some better names: [code] mathematicalOperation expr (or expression, if you must) operatorSign oper (or operation) getFirstDigitIndex iDigit operatorSignIndex iSign firstNumber strNum1 notice that these …

Member Avatar for tux4life
0
265
Member Avatar for hurbano

>You normally don't need the ignore( ) between two input >statements of the same type. Or when the getline() is before the cin>>.

Member Avatar for tux4life
0
121
Member Avatar for everydaybh

Your program has too many errors to enumerate. You need to learn the basics (like you can't say Public instead of public; capitalization counts). Get a decent book and work through the examples.

Member Avatar for tux4life
0
179
Member Avatar for Aelphaeis

[icode]conio.h[/icode] (if available to you) has the function [icode]_getch()[/icode] which is unbuffered and does not echo the character read.

Member Avatar for Aelphaeis
0
399
Member Avatar for clutchkiller

Presumably something needs to be declared as virtual in Utility. Without code, it's hard to say exactly what.

Member Avatar for clutchkiller
0
226
Member Avatar for ammonation42

Let's see. There are 24 places that the pieces could be. There are 15 identical pieces for each player, and only one player's pieces can be in a particular position. The simplest data structure that fits these requirements is an array of 24 integers. Zero means the space is empty. …

Member Avatar for nucleon
0
104
Member Avatar for danishamman

asin() in <cmath> Try [url=http://www.cplusplus.com/reference/clibrary/cmath/asin/]here[/url] for a description.

Member Avatar for tux4life
0
112
Member Avatar for 1newguy

And you're using double-quotes for character constants. You should be using single-quotes.

Member Avatar for siddhant3s
0
169

The End.