1,174 Posted Topics

Member Avatar for marlowd

Perhaps you might start by looking into [URL="http://msdn.microsoft.com/en-us/library/aa446639(VS.85).aspx"]GetFileSecurity Function[/URL]. And from there on try to figure out the relevant parts of the Windows authorization.

Member Avatar for mitrmkar
0
113
Member Avatar for fugnut

[QUOTE=fugnut;1147673]anyone? How do you load in values to a variable?[/QUOTE] If you add the following [ICODE]cout <<[/ICODE] there [code] while( getInput(infile, ID, Sales) ) { cout << "ID:\t" << ID << "\tSales:\t" << Sales << endl; displayResults(outfile, ID, Sales); } [/code] What is the output on your screen?

Member Avatar for mitrmkar
0
115
Member Avatar for josolanes

'this' is always a pointer, so e.g. [ICODE]this.Year[/ICODE] is wrong, it has to be [ICODE]this->Year[/ICODE]. [ICODE]operator <()[/ICODE] is 'const', that means that every class method you call inside it, must also be 'const', in this case it means [ICODE]getMonthInt()[/ICODE]. Then again, you might directly access the [ICODE].Month[/ICODE] member variable. To …

Member Avatar for josolanes
2
224
Member Avatar for tetron

Is your code using [ICODE]assert()[/ICODE] or any of the VS macros wrapped around [ICODE]assert()[/ICODE]? Furthermore, have you written e.g. [code] #ifdef _DEBUG .. do something here .. #endif [/code] If you have, then make absolutely sure that you are not changing anything via those pieces of code.

Member Avatar for HealBrains
0
116
Member Avatar for Agello

[CODE] #include <stdio.h> #include <stdlib.h> int main(){ [COLOR="Red"]char[/COLOR] option, [COLOR="Red"]factor[/COLOR]; printf("Choose your operator: \"+\" ; \"-\" ; \"*\" ; \"/\" \n>\t"); scanf(" %c", &option); printf("You chose : %c \nChoose your factor:\n>\t", option); [COLOR="Red"] scanf[/COLOR]("[COLOR="Red"]%d[/COLOR]",[COLOR="Red"] &factor[/COLOR]); printf("You chose : %i\n",factor); printf(" %c", option); if(option=='+'){ printf("It's WORKING!"); system("pause"); } return 0; } …

Member Avatar for Agello
0
262
Member Avatar for Ultratermi

[QUOTE=Ultratermi;1146086]Hey, can someone tell me where I have to start? I wanna make a program like cheat engine but I have no clue how :o... Im [B]not[/B] a beginner ( but also not an expert :P ) in C++(/CLI)... What functions do I need? etc. :p Thx ;D[/QUOTE] Mmmm, at …

Member Avatar for Ultratermi
-3
567
Member Avatar for atticusr5

Please forget [I]missing library files[/I], as a matter of fact, what do you actually mean by missing library files? The only way that it seems to run succesfully (that is, without crashing), is to have it read an empty input file. [EDIT] What compiler are you using .. - at …

Member Avatar for atticusr5
0
180
Member Avatar for code zombie

Apparently you want to [COLOR="Red"]return a reference[/COLOR], like so [code] friend std::ostream[COLOR="Red"] &[/COLOR] operator<<(std::ostream& os, const u_string& uStr); // and std::ostream [COLOR="Red"]&[/COLOR] operator<<(std::ostream& os, const u_string& uStr) { os<<uStr.str; return os; } [/code]

Member Avatar for code zombie
0
119
Member Avatar for coachkrzyzewski

[QUOTE=coachkrzyzewski;1146211]How do I use the STL stack implementation with [I]pointers to my TreeNode class[/I]?[/QUOTE] You had a stack of TreeNode objects, not pointers to such. So .. [CODE] stack<TreeNode * > s; TreeNode * a = new TreeNode(val); s.push(a); [/CODE]

Member Avatar for dusktreader
0
167
Member Avatar for daviddoria

Most likely GCC is unable to locate <stdarg.h>, just like <stddef.h> in your other thread. Something is wrong/misconfigured/missing with your setup/environment - that's all I can think of. Have you tried to locate these files on your computer? Try passing the [ICODE]-v[/ICODE] option to GCC so that you get to …

Member Avatar for daviddoria
0
1K
Member Avatar for maharjun

In addition to what's been already stated. Only focusing on a very basic thing. This basic thing here is that you try to delete memory that was never allocated in the first place. In other words, you do [ICODE]delete string[/ICODE] without having allocated any memory to [ICODE]string[/ICODE] and [ICODE]string[/ICODE] is …

Member Avatar for mattjbond
0
181
Member Avatar for pato wlmc

Try specifying the full path to the .ico file, like [code] hIcon = (HICON) LoadImage(NULL, "c:\\full\\path\\to\\menu_two.ico", IMAGE_ICON, 32, 32, LR_LOADFROMFILE);[/code] [ICODE]GetLastError()[/ICODE] gives you an error code that might be helpful when figuring out the reason of a failing Win API call. See an example of [URL="http://msdn.microsoft.com/en-us/library/ms680582(VS.85).aspx"]Retrieving the Last-Error Code[/URL]

Member Avatar for mitrmkar
0
713
Member Avatar for gnarlyskim

One thing to note, you have had there a simple out-of-bounds write [code] // 'n + 1' elements -> last valid index is 'n', not n + 1 double * coeff = new double[ n + 1 ]; for(int i= [COLOR="Red"]n + 1[/COLOR] ;i>=0;i--) // here it would go wrong …

Member Avatar for gnarlyskim
1
184
Member Avatar for XinJiki

[QUOTE=XinJiki;1143322]I need help with reading each letter at a time[/QUOTE] To access each character of a std::string one at the time, you can use the [ICODE]operator [][/ICODE] [code] string s = "abcdefg"; for(size_t ii = 0; ii < s.length(); ++ii) { cout << "s[ii]: " << s[ii] << endl; } …

Member Avatar for Ikejae
0
1K
Member Avatar for daviddoria

See .. [URL="http://www.parashift.com/c++-faq-lite/templates.html#faq-35.18"]Why am I getting errors when my template-derived-class uses a nested type it inherits from its template-base-class?[/URL]

Member Avatar for daviddoria
0
272
Member Avatar for noofin

One small/solid example that probably is what you are after is [URL="http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=registerhotkey&ReleaseId=1833"]Using RegisterHotKey with MOD_NOREPEAT[/URL] Depending on your compiler/SDK, it might be that you are unable to use the [ICODE]MOD_NOREPEAT[/ICODE] flag, in which case, just don't use that flag anywhere.

Member Avatar for mitrmkar
0
123
Member Avatar for Swiftle

>> If I use Entry *Index[100]; Assuming the destructor still looks like [code] Dictionnaire::~Dictionnaire(){ for(int i = 0; i < indiceCourant; i++){ delete Index[i]; } [COLOR="Red"]delete [] Index[/COLOR]; } [/code] [ICODE]delete [][/ICODE] is guaranteed not to work, so rather use [ICODE]Entry ** Index[/ICODE] or otherwise remove [ICODE]delete [] Index[/ICODE] altogether. …

Member Avatar for mitrmkar
0
143
Member Avatar for alma27534

[QUOTE=alma27534;1143091] ?Invalid number of arguments Press any key to continue . . . [CODE] int main(int argc, char **argv) { if (argc != 3) { printf("?Invalid number of arguments\n"); system("pause"); exit(1); } }[/CODE][/QUOTE] Well, it is expecting to be run with 2 arguments, if those arguments are not present on …

Member Avatar for alma27534
0
303
Member Avatar for KRal

[QUOTE=KRal;1144336]The compiler will not allow access. I know I am overlooking something.[/QUOTE] You have to pay attention to the method signatures. The class declaration has [code] // returns a reference to a Fraction, and takes in a reference // to Fraction friend Fraction [COLOR="Red"]&[/COLOR] operator + (Fraction [COLOR="Red"]&[/COLOR] c); [/code] …

Member Avatar for mrnutty
0
138
Member Avatar for e40thrilla

The if-statements there are fundamentally plain wrong. If you write .. [code] if (ValueRead == 'A' || 'a') [/code] that evaluates to [code] if (ValueRead == 'A' || true) [/code] which is always true -> [ICODE]counter[/ICODE] is incremented. So, you want to write the if-statements like .. [code] if (ValueRead …

Member Avatar for mitrmkar
0
1K
Member Avatar for jonyb222

One thing to check, are you absolutely sure that the NodeItem.cpp is included in the compilation? Have you taken a look at C++ FAQ [URL="http://www.parashift.com/c++-faq-lite/strange-inheritance.html#faq-23.10"]What does it mean that the "virtual table" is an unresolved external?[/URL]

Member Avatar for jonyb222
0
8K
Member Avatar for tomtetlaw
Member Avatar for vidit_X

A couple of suggestions; [LIST] [*]Maybe change the signature of [ICODE]int mv(...) [/ICODE] to [ICODE]void mv(...) [/ICODE] Currently you have the function returning a value, which is completely ignored by the [ICODE]main()[/ICODE] function, hence serving no practical use. And in case of errors, you throw exceptions, which makes the 'return …

Member Avatar for mrnutty
0
380
Member Avatar for jonyb222

> `Arrival.h:7: error: expected class-name before ‘{’ token` > > `#ifndef ARRIVAL_H` > `#define ARRIVAL_H` > > `#include "Event.h"` > > `using namespace std;` Most likely you are not including anything from the std namespace via the Event .h, so the `namespace std` remains unknown to the compiler and cannot …

Member Avatar for jonyb222
0
558
Member Avatar for p.jeet

[QUOTE=p.jeet;1144028] COuld any one help me in solving tis issue?[/QUOTE] If you had posted the code using [I]code tags[/I], the code would probably be readable. Now it is not. Perhaps see [URL="http://www.daniweb.com/forums/misc-explaincode.html"]What are code tags?[/URL].

Member Avatar for p.jeet
0
93
Member Avatar for sexyzebra19

[QUOTE=sexyzebra19;1144090]I had a similar problem with my program crashing earlier, see [url]http://www.daniweb.com/forums/thread263455.html[/url] and i was advised to do this...is it not correct?[/QUOTE] Jonsca already pretty much explained your current situation, but I still try to clearly point out what is wrong below ... [code] Matrix::Matrix(int rows, int cols) { // …

Member Avatar for sexyzebra19
0
102
Member Avatar for sexyzebra19

Just in case you don't know about illegal filenames, see [URL="http://en.wikipedia.org/wiki/File_name#Reserved_characters_and_words"]Filename / Reserved characters and words[/URL] So having a filename containing e.g. semicolon(s), would quite likely be a mission impossible.

Member Avatar for sexyzebra19
0
337
Member Avatar for rjani1

[QUOTE=rjani1;1143528]I have tried that but this does not produce an output on the screen. I always seem to have to use the newline character (\n) in order to get anything.[/QUOTE] Have you tried [ICODE]fflush(stdout);[/ICODE] ?

Member Avatar for rjani1
0
1K
Member Avatar for niro_fernando

[QUOTE=niro_fernando;1143526]plz i want to know information about class libraries in C C++ Java .i want to know about History,how they work , etc[/QUOTE] That's a rather broad question to be answered (don't you think?), so maybe start for example [URL="http://en.wikipedia.org/w/index.php?title=Special%3ASearch&redirs=0&search=class+library+&fulltext=Search&ns0=1"]here[/URL].

Member Avatar for niro_fernando
0
96
Member Avatar for HBK_100
Re: File

[URL="http://www.cplusplus.com/reference/clibrary/cstdio/fprintf/"]fprintf()[/URL] takes a [ICODE]FILE *[/ICODE] as its [I]first argument[/I] (which would be in your case the variable [ICODE]customer[/ICODE]). Then your logic is backwards, in the sense that if the file is opened succesfully, you inform the user about it. But if the opening of the file fails, you'll be trying …

Member Avatar for WaltP
0
118
Member Avatar for sgw

[QUOTE=sgw;1142973]Bloodshed Dev C++.[/QUOTE] Bloodshed Dev C++ is actually the IDE, i.e not a compiler. Perhaps you are using MingW's [I]GCC[/I]?

Member Avatar for ppl154
0
141
Member Avatar for bogenbroom

After the failed attempt to open the file, [ICODE]inFile[/ICODE] is in error state. You want to do [ICODE]inFile.clear();[/ICODE] to make it functional again.

Member Avatar for bogenbroom
0
1K
Member Avatar for TheWolverine

Two options to make this sort(...) work, would be Make the [ICODE]fooSort()[/ICODE] a [I]static[/I] member function, so .. [code] [I]static[/I] bool fooSort(const Foo * fooPointer1, const Foo * fooPointer2) { return fooPointer1->fooMember1 < fooPointer2->fooMember2; } [/code] or take the [ICODE]fooSort()[/ICODE] function outside of the class completely, so .. [code] bool …

Member Avatar for dusktreader
0
4K
Member Avatar for CppBuilder2006

[QUOTE=CppBuilder2006;1138796]why does this program have an exception in VC++ 2008 Express? I tested it in a borland compiler & there was no exception.[/QUOTE] VC probably destructs the object as soon as the reference has been set i.e. before any output. Just out of curiosity, when you run the program under …

Member Avatar for CppBuilder2006
0
209
Member Avatar for sexyzebra19

[QUOTE=sexyzebra19;1143037]I am not able to change anything in the header file, so is there a way to initalize these variables within the .cpp file? [/QUOTE] Yes, there is. For example, [code] Matrix::Matrix(int mdim_, int ndim_) { this->mdim_ = mdim_; this->ndim_ = ndim_; [/code] You could/should also change to .. [code] …

Member Avatar for sexyzebra19
0
324
Member Avatar for abhimanipal

[QUOTE=abhimanipal;1140797]This code gives compile time error but I am unable to understand the reason. [/QUOTE] Which error? Only thing that I see missing, is a header file for [ICODE]getch();[/ICODE]. [EDIT] Oh, and it leaks memory ;)

Member Avatar for sheff_cc
0
129
Member Avatar for Stefano Mtangoo

If the private data is [I]static[/I], i.e. all instances of the class share the static private data, then there is no need for the class object as an argument. If the private data is [I]non-static[/I], then you must have the class object as an argument because the object instance actually …

Member Avatar for sheff_cc
0
1K
Member Avatar for techie929

[QUOTE=techie929;1142584]Line 40[/QUOTE] Since [ICODE]tree_node[/ICODE] is nested inside the [ICODE]BinarySearchTree[/ICODE] class, you need to apply the scope resolution operator .. [code] [B]BinarySearchTree[/B]::tree_node * BinarySearchTree::inorderSuccessor(tree_node* p ){} [/code] or make the [I]declaration of [/I][I]tree_node public[/I] and use a typedef .. [code] typedef BinarySearchTree::tree_node treeNode; treeNode * BinarySearchTree::inorderSuccessor2(tree_node* p ){} [/code]

Member Avatar for mitrmkar
0
111
Member Avatar for konata_89

Adding to what's been said above, GCC spotted a thing in the [ICODE]list()[/ICODE] function, it said; [B]warning: too many arguments for format[/B] That means that the [ICODE]printf(...)[/ICODE] call there needs attention. There is a mismatch between the format string and the number of arguments you actually pass in. Then you …

Member Avatar for konata_89
0
129
Member Avatar for techie929

[QUOTE=techie929;1141517]//when I delete root node from bst [/QUOTE] line 29: declares [ICODE]tree_node* parent[/ICODE] (and leaves it [I]uninitialized[/I]) Then, if the root node will be a match for the data you search for, you end up using the uninitialized pointer from line 44 onwards.

Member Avatar for VernonDozier
0
95
Member Avatar for indigo.8

[QUOTE=indigo.8;1142112] I replaced the Cin>> with system("pause") and system ("CLS") and still have the same issues but when they are removed the pointer is passed to the display class correctly.[/QUOTE] The [ICODE]int Signal[280];[/ICODE] being local to the [ICODE]FileFunc::LoadFile()[/ICODE] function is a guaranteed source of trouble for you. You may detect …

Member Avatar for indigo.8
0
114
Member Avatar for Notme

One option would be to read in one character at the time, using e.g. [URL="http://www.cplusplus.com/reference/clibrary/cstdio/fgetc/"]fgetc()[/URL], filtering out the unwanted characters. To write to output file, you'd probably like to use the counterpart [ICODE]putc()[/ICODE]. This would narrow down the task at hand, which might be a good idea given your 5 …

Member Avatar for Dave Sinkula
0
1K
Member Avatar for Matt323

[QUOTE=Matt323;1140927]I run it again and it opens the key, however i still can't see this key in regedit, after restarting the program multiple times and refreshing.[/QUOTE] If you don't see your program output the "Checking for config failed" text, then the key [I]is[/I] in the registry, in other words the …

Member Avatar for mitrmkar
0
386
Member Avatar for johndoe444

[QUOTE=johndoe444;1140018]I don't want to declare child as pointer. Is this possible to keep it as array instead of pointer?[/QUOTE] A bit unclear to me will you be writing C or C++. But anyway, if C++ is allowed, you might store the child nodes in a std::vector, so .. [code] struct …

Member Avatar for mitrmkar
0
97
Member Avatar for valeriy_zf

[QUOTE] Another issue: I draw the picture not directly on the Form, but on the Panel. The[I] DoubleBuffering property is protected[/I] here :( [/QUOTE] You might derive from Panel class and use the derived class as your Panel with DoubleBuffering enabled. Lukezzz was doing the same thing [URL="http://www.daniweb.com/forums/thread258242.html"]here[/URL]. Though it …

Member Avatar for valeriy_zf
0
147
Member Avatar for themarval

[QUOTE=themarval;1139517] .cpp files? even for such a short program?[/QUOTE] As far as I understood, this seems to be partly about having multiple files in your project, hence two .cpp files plus a header. Have yourself [I]main.cpp[/I], which comes with the [ICODE]main()[/ICODE] function implementation and #includes the header file (.h). The …

Member Avatar for jonsca
0
172
Member Avatar for PDB1982

When you have a static non-const member variable, it also needs definition outside the class declaration, so you need to have it like [code] <snip> class HotDogStand { public: void JustSold(); int Cart; int IdNumber; int SalesToday; int TotalSales; int IncrementalSale; static int DogCounter; }; // definition here, outside the …

Member Avatar for mitrmkar
0
87
Member Avatar for mrinal.s2008

I think this might be related to the file's content. Try saving the following numbers to your file (with e.g. Notepad) and see if it makes a difference. 1 2 3

Member Avatar for mitrmkar
0
300
Member Avatar for igodspeed

The file that you posted above (that is, your post #1), actually contains both #include <iostream> using namespace std; So given that you are really getting those errors that you posted, now, are you absolutely sure that you are compiling the correct file(s)? I have a hunch that you are …

Member Avatar for igodspeed
0
243
Member Avatar for Marson

[QUOTE=Marson;1138878]Unless I am misunderstanding, which is completely possible haha[/QUOTE] Ancient Dragon didn't say that the keywords are to be hard-coded. So you'll just have to process the command line arguments and gather the keywords for later lookups. Depending on how many keywords there could be, it might be easier to …

Member Avatar for WaltP
0
186

The End.