1,296 Posted Topics

Member Avatar for StainlessSteelR

You define calculateRetailprice function but call calculateRetailPrice... C++ names are case-sensitive. A linker detects undefined reference to calculateRetailPrice... One letter price ;)

Member Avatar for StainlessSteelR
0
111
Member Avatar for NinjaLink

If unlucky user accidentally types a wrong char your program comes to loop forever because subsequent cin inputs do nothing until [icode]cin.clear()[/icode] call. Always check input result, for example: [code=cplusplus] if (cin >> number) { // that's ok } else { // eof or not-a-number // Recovery? It's the other …

Member Avatar for ArkM
0
3K
Member Avatar for M00nDancer

No need in strchr, islower etc for latin letters only. [code=cplusplus] void CountUppers(std::istream& is) { if (!is) return; int cnt['Z'-'A'+1] = {0}; char c; while (is.get(c)) { if (c >= 'A' && c <= 'Z') ++cnt[c-'A']; } for (c = 'A'; c <= 'Z'; ++c) std::cout << c << '\t' …

Member Avatar for ArkM
0
101
Member Avatar for mikeregas

The root variable is not initialized (by 0) before dictionary loading. It has a garbage pointer value so the program are trying to insert nodes to nowhere (memory access violation or another troubles follows)...

Member Avatar for ArkM
0
175
Member Avatar for PhoenixInsilico

Because your Point::getXYZ does nothing (see x target instead of X, y instead of Y ... ;) ).

Member Avatar for sidatra79
0
95
Member Avatar for srivtsan
Member Avatar for srivtsan

Better break one of two identical threads on this topic (this or there on C forum) ;)... I don't understand why you sent your C++ program to C forum?..

Member Avatar for invisal
0
247
Member Avatar for CTOBiz

[url]http://www.dekart.com/products/encryption/private_disk/[/url] [url]http://electronicdesign.com/Articles/Index.cfm?AD=1&ArticleID=11266[/url] [url]http://www.secureyourflashdrive.com/[/url] [url]http://www.edgetechcorp.com/usb-flash-drives/guardian-secure-flash-drive.asp[/url] [url]http://www.radix-int.com/ksafe.php[/url] and much more... Flash memory self-destruction is a well-known optional feature of modern microcontollers.

Member Avatar for ArkM
0
129
Member Avatar for mibit
Member Avatar for scjohnny

If VC++ Express distributive is too big for your channel, download and install much more compact Code::Blocks IDE with MinGW C++ compiler bundled: [url]http://www.codeblocks.org/[/url]

Member Avatar for scjohnny
0
109
Member Avatar for a.self

1. Let's suppose that you have a collision with word "table". The LinearProbing finds a new free location then places the word into this cell. But the next occurence of the word "table" gets collision again - and linearProbing finds the next free location, it does not check if the …

Member Avatar for a.self
0
161
Member Avatar for inumbris

Visual C++ editor shows text blocks deselected by conditional compilation directives as grayed (it's a stable state until you don't tread on #if-#else structure). Check #if-#endif balance and conditions in the new header version...

Member Avatar for ArkM
0
255
Member Avatar for mrboolf

Imagine your program user's reaction: Surprise! You waste a time because "the program tried to process a division by zero. Any results should not be trusted."... Obviously the best design solution is: DO NOTHING. Let the program catch divide by zero exception. It's not a problem of a low-lelel class. …

Member Avatar for mrboolf
0
121
Member Avatar for localp
Member Avatar for localp

[icode]cin >> char_array[/icode] extracts only one word from input stream (upto whitespace occured - blank, tab or newline). The rest of typed string will been extracted with the next operator >> calls. For example if the user typed "Happy Guppy" then only Happy will be extracted from cin. To discard …

Member Avatar for ArkM
0
130
Member Avatar for RohitSahni

[QUOTE=RohitSahni;732602]001 00002 0000003 00004 000005 6 000007 008009 ------------------------------------------------------------------------------------------------------ GBL UTG.L 0692861 DCGB 000000 0 205750 826UTG GBL UU.L 0646233 DCGB 000000 0 722501 -371UU. I have the above data line by line each and coloumn has fixed width then in those i want to assign 9 coloumns to variables …

Member Avatar for ArkM
0
392
Member Avatar for faisaly

Well, you demonstrate absolutely senseless code (n is not initialized). And what's your question?

Member Avatar for Freaky_Chris
0
136
Member Avatar for gayatri.saha

[QUOTE=WaltP;731607]Why? It increments [B]i[/B], calls [ICODE]cube[/ICODE] with the new value, then returns the answer to [B]y[/B]. What's undefined about it? [B]i[/B] isn't modified twice.[/QUOTE] That's because cube is not a function name: it's a macros. We (not me, I never use macros) have: [code=c] # define cube(x)(x*x*x) int x = …

Member Avatar for WaltP
1
109
Member Avatar for meddlepal

Where was defined the type ptr? Why Node and node typenames occured in err messages? See also error C2244 description in MSDN...

Member Avatar for meddlepal
0
191
Member Avatar for freelancelote

You are trying to build absolutely senseless, absurd class NoFather (remember The House That Jack Built... ;) ?): [code=cplusplus] class NoFather { ... private: NoFather DataNoFather; }; [/code] Well, we have an object of type NoFather which has a member of type NoFather which has a member of type NoFather... …

Member Avatar for freelancelote
0
109
Member Avatar for Trekker182

1. Correct function body, of course. Absolutely clear declaration: [code=cplusplus] void arrSelectSort(int arr[], int size); // the same as void arrSelectSort(int *arr, int size); [/code] 2. It seems you forgot to initialize total var...

Member Avatar for ArkM
0
485
Member Avatar for muya08

Look at this loop condition. If it's true it's true forever (not forever: until inevitable crash). [code=cplusplus] int i; for (i = 1; zahl != 0; i++) { // Congratulation! It's loop until all core was overwritten... arr[i] = zahl; //storage of given number } [/code]

Member Avatar for ArkM
0
136
Member Avatar for AcidG3rm5

[code=cplusplus] void setDateMenu(Date myDate); [/code] You pass Date by value so set a new date to Date copy. The original object is intact. Pass by reference: [code=cplusplus] void setDateMenu(Date& myDate); [/code] Common error... I hope now you know that argument passed by value in C and C++ ;)...

Member Avatar for ArkM
0
122
Member Avatar for jugnu

[QUOTE=jugnu;731908]When i use a variable type [B]double[/B] the value [B]e.g 345624.769123[/B] rounded to [B]345625[/B] but when i take [B]5 digits[/B] before decimal [B]i.e 34562.4769123[/B] then it shows [B]34562.5[/B] Please explain Why? Thanks[/QUOTE] Please explain where and when?

Member Avatar for ArkM
0
177
Member Avatar for frank*

Of course, it's possible, all viruses do that ;) . So you will have a lots of troubles with anti-virus protection on computers of your masterpiece unhappy users...

Member Avatar for ArkM
0
102
Member Avatar for volscolts16

[QUOTE=volscolts16;731981]What is a clock tick equal to in ctime??[/QUOTE] The time_t type is an implementation-defined arithmetic type capable of representing times. Use difftime function to get the difference between two times of type time_t in seconds as a double value: [code=c] #include <time.h> ... time_t t; time(&t); printf("time_t step %f …

Member Avatar for ArkM
0
122
Member Avatar for a.self

1. It seems you don't implement any hash tables. A hash table is a container with insert, find and (may be) erase operations. But I can see only chimerical class - a mix of a fixed data file reading from unknown (for me) source, mysterious linearProbing method and final printing. …

Member Avatar for a.self
0
213
Member Avatar for minas1

From the C++ Standard: [quote]The expression E1[E2] is identical (by definition) to *((E1)+(E2)).[/quote] Sometime pointer arithmetics code is evidently cleaner than "subsripted" one: [code=cplusplus] int countDigits(const char* str) { int n = 0; if (str) while (int c = *str++) if (c >= '0' && c <= '9') ++n; return …

Member Avatar for ArkM
0
1K
Member Avatar for Srynx

I can't crank an engine. Look at my car mark, please: it's a Crow Victoria. Do you have any idea? [url]http://www.daniweb.com/forums/thread78223.html[/url]

Member Avatar for Srynx
0
85
Member Avatar for thekevin07

The main criteria for the right solution of deserialization is: you must suspect that all data were crippled, edited by mad operators, data file name was changed, you get another, wrong file etc. Deserialization module must cope with all these situations (at least detect them)... Probably the best deserialization modules …

Member Avatar for Lerner
0
345
Member Avatar for shankhs

I don't understand what for C# code appeares here. There are a lots of insertion (and others) sort C codes in INET. For example, that's one from the excellent tutorial [url]http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_sorting.aspx#insert[/url] [code=c] void jsw_insertion ( Str a[], int n ) { int i; for ( i = 1; i < …

Member Avatar for ArkM
0
164
Member Avatar for Donnovan

[QUOTE=Beginner+597;729364]hi everyone, I'm trying to write a program that calculates the the fourth sqrt() of an int ..., can someone help me thnxx[/QUOTE] And where is the product of your efforts? Remember classics: I'm trying to write a program to hop on the Moon...

Member Avatar for DavidB
0
148
Member Avatar for Manutebecker

[QUOTE=Manutebecker;731254]Topic... just wondering if it would be friend or pointers in the main or something else...[/QUOTE] It depends. Can you describe some program cases where you need to share (polysemantic term) variables?

Member Avatar for ArkM
0
95
Member Avatar for minas1

It's not a problem to allocate 2D array or what else in C++. The problem is: how do you want access the allocated storage. You know that it's impossible to declare 2D array variable with run-time defined extents in C and C++. The most straightforward approach in C style but …

Member Avatar for ArkM
0
123
Member Avatar for smart_pc

Good idea! Free advice: don't waste a time to hire assembler programmers. Only 50 years ago programs of some million instructions were written without any assemblers in native machine codes. The new revolutionary OS kernel fits in some thousand instructions only. Obviously no need in assembler programmers to conquer this …

Member Avatar for ArkM
0
108
Member Avatar for Somersett

Don't flatter yourself with the program of 1000 lines: it is a small program (max 2 days on implementation ;)). So the true problem is not a number of variables per se. It's not a common rule, but a well-designed function has 1-5 parameters. If it has 10 or more …

Member Avatar for Somersett
0
291
Member Avatar for daviddoria

Try this (add includes): [code=cplusplus] using std::flush; using std::cout; using std::endl; using std::cin; class Aircraft { public: Aircraft() { cout << "Aircraft is up!" << endl; } virtual ~Aircraft() {} virtual void doSomething() = 0; }; class Fighter: public Aircraft { public: ~Fighter() { cout << "Fighter landed." << endl; …

Member Avatar for ArkM
0
131
Member Avatar for king_blat

[code=cplusplus] outfile<<name<<m1<<""<<m2<<""<<m3; [/code] Why empty string literals?.. Where is the last line terminator ('\n') ? Your text file is ill-formed...

Member Avatar for mrboolf
0
121
Member Avatar for orwell84

Both C and C++ provide for (implementation defined) asm declaration (builtin assembler code) so the formal answer is "Yes, you might do that". Can you - that's a question. It is better to bootstrap a new system from the scratch in C because the C runtime support is much more …

Member Avatar for ArkM
0
148
Member Avatar for z00mit

I don't see any MiniDump class in your post (only MiniDumpHelper), but... Obviously SetUnhandledExceptionFilter wait a pointer to ordinar function (exception handler). But non-static member function is not an ordinar function and a pointer to it is not a pointer to ordinar function. Make it a static mamber (if possible): …

Member Avatar for ArkM
0
515
Member Avatar for minas1

By default class definition body starts with private zone. So you declare both operator= and operator+= as private members of Matrix (look again at you class Matrix). Well, you can't access them outside Matrix member functions and friends of the Matrix class. But your main function is not a friend …

Member Avatar for minas1
0
722
Member Avatar for robgeek

That's wrong expression statement: [code=cplusplus] *item--; [/code] It treated as *(item--) - see C++ operator priority table (or better write parentheses). So the program change a pointer only. For in/out parameters use references: [code=cplusplus] void Erase( int ar[], int& item, int7 Search) ... item--; // ok, decrement passed by reference …

Member Avatar for ArkM
0
202
Member Avatar for foggy_coder

What is it "cursor pointer"? I know cursor:pointer pair in CSS, but it's the other story...

Member Avatar for ArkM
0
144
Member Avatar for drdolittle

[QUOTE=cikara21;730555][code=c++] //-------------------------------------- int A[2][2]={1,2,3,4}; //--overflow func(A); //-------------------------------------- int A[1][4]; A[0][0] = 1; A[0][1] = 2; A[0][3] = 3; A[0][4] = 4; //-------------------------------------- [/code][/QUOTE] What? Where is overflow?

Member Avatar for grumpier
0
121
Member Avatar for Xarver

Read SDL tutorials carefully then correct misprints in you sources. Must be SDL_DisplayFormat, SDL_SetVideoMode etc...

Member Avatar for Xarver
0
354
Member Avatar for freelancelote

1. Where is an object stored? All non-static members stored there, in the same place: [code=cplusplus] MyClass ImInStaticStorage; void where() { MyClass ImOnTheStack; MyClsss* pointToTheHeap = new MyClass; ... delete pointToTheHeap; } [/code] 2. Initially it points to nowhere if you don't initialize it (has unpredictable value). 3. What to …

Member Avatar for ArkM
0
96
Member Avatar for seanl1

There are 250*2^24 possible bit patterns for 2-addr instructions. There are 2^32 bit patterns totally. So there are 2^32 - 250*2^24 free bit patterns for 1-addr instructions. Every 1-addr instruction occupies 2^12 bit patterns for all possible addresses. Therefore (2^32 - 259*2^24)/2^12 = 2^20 - 250*2^12 possible 1-add instruction. It's …

Member Avatar for ArkM
0
552
Member Avatar for Nemoticchigga

The 1st printf in the original post ([icode]fprintf(txtFile, "%s", "\n");[/icode] ) should work too. The simplest way in C style is [icode]fputc('\n',txtFile)[/icode]. Apropos, [code=cplusplus] out_file << "\nHello, World"; out_file.close(); [/code] makes ill-formed text file where the last line is not terminated by line separator...

Member Avatar for Freaky_Chris
0
203
Member Avatar for johnray31

1. No language defined limits. Obviously, the language implementation (compiler) may declare such limit (don't worry, it's a huge number ;) . For example, VC++ 2008 eats this nightmare: [code=cplusplus] void*********************************************************************Ooh; [/code] 2. It's an error. Any object may been (identically) declared in some places but must have one and …

Member Avatar for Narue
0
281
Member Avatar for GaryChine

Think: a preprocessor expands macros not only before the program run but before a compiler process sources! I can't just imagine what kind of useful macros you hope to invent... As usually, the best MxN code burst medicine is polymorhism. But now I can't suggest any solution on the too …

Member Avatar for GaryChine
0
87

The End.