Posts
 
Reputation
Joined
Last Seen
Ranked #1K
Strength to Increase Rep
+7
Strength to Decrease Rep
-1
79% Quality Score
Upvotes Received
23
Posts with Upvotes
20
Upvoting Members
15
Downvotes Received
6
Posts with Downvotes
6
Downvoting Members
4
14 Commented Posts
0 Endorsements
Ranked #417
~73.4K People Reached
Favorite Forums
Favorite Tags

118 Posted Topics

Member Avatar for SoftEngGroupE

If you have a sufficient version of microsoft visual studio you might be able to use the CImage class [URL="http://msdn.microsoft.com/en-us/library/d06f3fhw(VS.80).aspx"]http://msdn.microsoft.com/en-us/library/d06f3fhw(VS.80).aspx[/URL] however, express doesn't have this. Otherwise it is a messy procedure as there is more than one jpeg encoding you probably will need to read up on bitmap headers or …

Member Avatar for palanethra.ag
0
653
Member Avatar for sjcomp

With template code you have to be careful on relying on the compiler. You can have broken code that the compiler does not complain about. Until you instantiate a class you cannot be sure that you have no conflicts. Your singleton method seems a little unusual to me it may …

Member Avatar for madGambol
0
251
Member Avatar for Jfunch

Hi i have only skimmed your code but there are a couple of things that stand out as potential problems 1: in remove number: with the first for loop you want the original size not `size -1`, otherwise, if you try to remove the last number in array it won't …

Member Avatar for tetron
0
148
Member Avatar for raseru

It is windows games programming books and articles that probably have the cleanest explanations of what you want to know. There are ways to short cut building a window, depending on the version of visual studio you use. but it is worth knowing how to construct a window without any …

Member Avatar for Frederick2
1
968
Member Avatar for CppBuilder2006

I'm not sure what the problem is going to be explicitly, but you might want to try adding paint() on activate aswell as on paint itself. I remember having an issue with when the window was drawing with VIsta but went away when I used a different approach. You could …

Member Avatar for CppBuilder2006
0
152
Member Avatar for jonymanolo
Re: HELP

[QUOTE=jonymanolo;1191248]is posible expalin my for what use %s in a code line [CODE]cmdLine.Format("\"%s\" \"%s\" %d %s %s %s", playerFile, moviePath, 10, cameraName, selectDate, movieID);[/CODE] i need now how works this code line[/QUOTE] It is used as a placeholder to substitute values into the place of: so the first %s is …

Member Avatar for tetron
0
90
Member Avatar for rtllz

[QUOTE=rtllz;1181687]I'm confused as to where im supposed to put the the location of the file such as C:\\Documents and Settings\\user\\Desktop\\myfile ??[/QUOTE] you will need a file extension too. the double [icode]\\[/icode] are needed for the direct string input but if you [CODE] std::string location = "C:\\folder1\\folder2\\my_file.txt"; std::cout << location << …

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

As salem stated you are asking for an input of a char which is a sinlge digit or letter. so this can only give one letter at a time however, you are also using a while loop so you are getting first [CODE] char digit; int count(0); while(cu != -1) …

Member Avatar for tetron
0
123
Member Avatar for spetsnaz26

you are very close to getting ti working the problem is how you are converting an [icode]int[/icode] to [icode]char[/icode] assuming that you are only going from 0 to 9 you can have [CODE] //this is either the relative or absolute file path std::string base_file = "data"; std::string after_number = ".txt" …

Member Avatar for spetsnaz26
0
255
Member Avatar for yaoc1987

[QUOTE=yaoc1987;1181667]im calling this function from main bin_p.binary_print(outs, n); ^that is in int main() void binary_print(ostream& outs, unsigned int n); ^this is in the header file [CODE] void rec_fun::binary_print(ostream& outs, unsigned int n) { if(n < 2) { cout << n << endl; } else if(n >= 2) { binary_print(outs, n/2); …

Member Avatar for vbx_wx
0
137
Member Avatar for KBL

[QUOTE=KBL;1171492]KB.cpp(18) : error C2447: missing function header (old-style formal list?) [CODE] public: Password(void); [/code] [/quote] I would not expect to see [icode]void[/icode] void being used as a parameter [icode]()[/icode] is standard. but what I don't see is a definition of [CODE]Password::Password() { } [/CODE] and the compiler might be complaining …

Member Avatar for KBL
0
25K
Member Avatar for B1GGS

caveat: This code is doing lots of things that look messy. Especially for the error that you are unfamiliar. Your error means that you need the .h file or at the top with somting like [CODE]int GenerateRandomValue(int v1, int v2);[/CODE] You will also need the definition of the function at …

Member Avatar for tetron
0
340
Member Avatar for Pelle_3

Without seeing a full example, it seems odd behaviour. As a first thought, I assume that you are talking about opening a file that is acting as a database and you want to move to the first entry. you might try explicitly adding the [icode]ios::beg[/icode] [CODE]fbin.seekg(0, std::ios::beg);[/CODE] if this doesn't …

Member Avatar for Pelle_3
0
199
Member Avatar for Afupi

[QUOTE=Afupi;1169435]Ok so after a few days, I finally got the 8 queens problem solved. After having so much trouble I decided to practice recursion by doing the same problem but with 32 knights. 8x8 board, place 32 knights without them attacking one another.[/QUOTE] A bit off topic so apologies :) …

Member Avatar for Afupi
0
570
Member Avatar for stricklypni

you have not got [icode]{}[/icode] matched in all places. The compiler won't give you a line number for this so if your code isn't too long and you still can't find the error post it. [QUOTE=stricklypni;1173753]I will show the code if you want to see the error.... Am still working …

Member Avatar for stricklypni
0
108
Member Avatar for Pynolathgeen

[QUOTE=Pynolathgeen;1171525]My program keeps crashing when not in debugging mode. So now i'm debugging manually, or well, log everything to find where it is crashing [code=C++] DirectX = new DIRECTX(); // Creating DirectX [/code] [/quote] is not calling : [QUOTE=Pynolathgeen;1171525] [code=C++] DIRECTX::DIRECTX(HWND Window) [/code] [/quote] but [CODE]DIRECTX::DIRECTX()[/CODE] so we can't see …

Member Avatar for tetron
0
131
Member Avatar for cpp.coder

> start quote: # include <stdio.h> abc (y++); // error here > end quote. This result surprised me too. I guess it is because y++ passes the variable into the function as y and then tries to further alter the variable after entering the function which adds potential undefined behaviour …

Member Avatar for cpp.coder
0
200
Member Avatar for VilePlecenta

Here is a sample header file: should have: 1- description to ensure that you understand your design 2 - meaningful class name the same as the .h file name you can have iterator classes in the same header 3 - function names that make sense 4- comments on how to …

Member Avatar for VilePlecenta
0
150
Member Avatar for micmagicfly

Main needs to cin [CODE] std::cout << "please enter operator" << std::endl; std::cin >> character; [/CODE] before [QUOTE=micmagicfly;1171541][code] switch (character) { case '+' : addition(); [/code][/QUOTE]

Member Avatar for tetron
0
126
Member Avatar for anugrah.agrawal

You are not describing all of the details very thoroughly: [QUOTE=anugrah.agrawal;1168939]....i am well versed with the algorithm to do this... PLease help!!!![/QUOTE] I am assuming that you are using visual studio To read the input from a GUI - either write an application that is part of the GUI or …

Member Avatar for anugrah.agrawal
0
166
Member Avatar for dchunt

Without seeing your code it is a tricky question to answer. What you probably want to do is put both programs into classes then you can create an instance of the class and decide whether to run it on the if say a simplified version of your code looked like …

Member Avatar for tetron
0
156
Member Avatar for buckkitty

[QUOTE=buckkitty;1169179]Hello, [code] double temp_data = NULL; //temporary matrix int u = 654; // u = the total number of periods in the time series [/code] bk[/QUOTE] There are some inconsistancies in your descriptions and implementation. If this isn't an assignment there are quicker ways to load the data. 1st this …

Member Avatar for tetron
1
99
Member Avatar for merse

const is a some what overrated concept that leads to more typing and maintenance. In your case myfunc is not const as it alters a member variable if this is not appropriate to be altered then you need to use a local [CODE] double myfunc(double x1,double x2, double x3) const …

Member Avatar for mattjbond
0
174
Member Avatar for strmstn

I have no tried playing around with this One approach is known as skinning or a skin This can change the style of how windows appear used to be popular for windows themes. Another approach is more re-writing the wheel where you use a window with no frame and redraw …

Member Avatar for tetron
0
146
Member Avatar for o0mkh0o

!st template class will compile fine until the code is used. [icode]TreePath[/icode] is not defined in the code you have shown Path has some risky behaviour [QUOTE=o0mkh0o;1168737] [CODE] T& getLastPathComponent(void) const { return *lastPathComponent; } [/CODE][/quote] using a pointer that you do not own without any error checking is dangerous …

Member Avatar for o0mkh0o
0
330
Member Avatar for PDB1982

I will try to be succinct: 1. a static member variable acts like a single common variable that is a global so there is only really one 'n' in the whole project 2. a constructor [icode]()[/icode]is called every time the computer has to allocate memory and give an address to …

Member Avatar for pecet
0
137
Member Avatar for stefy14

One approach is to treat all of your input as chars say using [icode]std::srting[/icode] [CODE] #include <string> #include <iostream> int main() [ std::string input; std::cout << "please enter data" << std::endl; std::cin >> input; //using an int instead of sizetype f //step over each char of input int sz = …

Member Avatar for tetron
0
139
Member Avatar for TaSkOnE

I am rusty on this but as you say if hWind = 0 then you are using a method that requires a handle to a window if this is 0 it most likely means that you have not created a window successfully. So your new might not have created a …

Member Avatar for TaSkOnE
0
2K
Member Avatar for dude1

if you load the file [icode]#include <fstream>[/icode] read in the file using [icode]std::ifstream("folder\\file.txt"[/icode] now two options load into a single string or line by line. Single [icode]std::string[/icode] will be easiest there are google articles on how to do this The next thing is [code] std::string data; //load data //this is …

Member Avatar for dude1
0
172
Member Avatar for C Newbie

you are asking sensible questions about how you would reverse the digits of a number. And the reason why you are having problems is that it is not defined behaviour - so to code it for non-integers requires a decision as to what is intended. Option one treat it as …

Member Avatar for phoenix911
0
2K
Member Avatar for emilo35

If your [icode]string[/icode] is just a [icode]std::string[/icode] then your write methods are not taking advantage of the methods available to you [icode].c_str()[/icode] this converts a std::string into a char * and [icode].size()[/icode] gets you the length of a string therefore [code] std::ofstream fout("test.txt", std::ios::bin); if(fout.is_open()) { fout.write(str.c_str(), str.size()); fout.close(); } …

Member Avatar for emilo35
0
184
Member Avatar for Kosithc

At a glance it looks as if the .dll is being included twice possibly under different names as all the errors come from [icode]MSVCP90D.dll[/icode] I am not sure how best to stop it though... [QUOTE=Kosithc;1159562]Thanks for reply! Header files, which i include to my project, were provided with Alglib and …

Member Avatar for Kosithc
0
630
Member Avatar for LeoC++

cout doesnt recognise arrays so you are outputting a pointer what you wanted to do is [CODE] #include <iostream> int main() { int list[12] = {8,1,11,4,2,9,10,5,3,12,6,7}; //can go faster but this is easiest to read for(int j =0 ; j < 12; ++j) { std::cout<<list[j] << " "; } //output …

Member Avatar for rahul8590
0
130
Member Avatar for bgx90

First glance it is [code] using namespace std; [/code] causes your compiler to find [icode]std::copy[/icode] instead of copy when it looks at copy

Member Avatar for bgx90
0
114
Member Avatar for josolanes

Coming in late you have colours that you want to convert to different types and formats: This would normally be a single set of formulae for each conversion and would not require a convert but if you are pairing names with values and vice versa couldn't you just use maps …

Member Avatar for josolanes
0
1K
Member Avatar for cwarn23

Just a minor point: php explode has a third optional parameter that limits the number of times to split [URL="http://www.tizag.com/phpT/php-string-explode.php"]http://www.tizag.com/phpT/php-string-explode.php[/URL] so [code] std::vector<std::string> php_explode(const std::string &divide, const std::string &to_explode, int max_number = -1); [/code] would be closer to the php_function signature but an easy modification to Nick's code

Member Avatar for tetron
1
666
Member Avatar for nizbit

your code appears to moving around a bit and Iwould make sure that everything is as safe as can be is pos an int? [CODE]ItemType *temp = new ItemType[pos];[/CODE] them new would fail with a -1; if so safer to have [CODE] if (pos == 1) { a[0] = key; …

Member Avatar for tetron
0
311
Member Avatar for CreativeCoding

msdn is a good place to start : [URL=" http://msdn.microsoft.com/en-us/library/system.windows.forms.systeminformation_properties.aspx "]http ://msdn.microsoft.com/en-us/library/system.windows.forms.systeminformation_properties.aspx[/URL] I think this is probably the one you wanted your output from the functions could use [icode]std::string[/icode] and then output with [icode]#include <iostream>[/icode] & [icode]std::cout <<[/icode] or to a file some of your coding seems unnecessarily non standard …

Member Avatar for tetron
0
150
Member Avatar for abhimanipal

[QUOTE=abhimanipal;1158745]Hello Everybody, [code=c++] int operator()() { return n++; } [/code] [/QUOTE] yikes this is not a good idea to call a function without a name I don't think I have ever wanted to overwrite the [icode]operator()[/icode] this is overloading a constructor in a class, change the name or use [icode]operator++[/icode] …

Member Avatar for mattjbond
0
160
Member Avatar for PDB1982

I probably should not jump into a thread where so many people have ready jumped in but here goes... You have a lot of posts but clearly there are somethings that have never quite grasped. First what you have to understand is what a rational number is: an integer is …

Member Avatar for tetron
0
530
Member Avatar for 28daniela28

I haven't gone through all your code yet, and there are some dangerous bits of code that are probably not currently causing an issue. If you have a function outside of a class it is best to pass in a variable to a function rather than access a global directly. …

Member Avatar for tetron
0
195
Member Avatar for rahulrulez

[QUOTE=rahulrulez;1158381] Here I need to use Graphics and mouse handling.. I'm totally new into Mouse programming in C++, still doing the coding with help of some online tutorials.. [/QUOTE] This is a question that seemed fairly easy to answer until I then looked at your code. I take it that …

Member Avatar for rahulrulez
0
185
Member Avatar for atticusr5

First when you encounter a problem you should break it down it to small chunks. Therefore start with some very simple data. is your code crashing or just not giving the output that you would expect? As a rule it is not a good idea to use [icode]ofstream[/icode] as a …

Member Avatar for tetron
0
89
Member Avatar for aianne

Your [icode]if[/icode]s are going awry again use {} every [icode]if[/icode], [icode]else if[/icode] and [icode]else[/icode] and many of your problems vanish without them [icode]if[/icode] will only run until next [icode];[/icode] [code] if(x == 1) {//always use me x = 3; }//and me else {//here too x = 4l }//etc [/code] [QUOTE=aianne;1158383]Hi! …

Member Avatar for WaltP
0
972
Member Avatar for Excizted

NetBeans are we talking Java... ? Most c++ code is platform independentant and linux implementations normally include use of codes that will work on both windows and linux, so this should be the end goal. That way the windows will be a bit harder but give you what you want …

Member Avatar for Excizted
0
123
Member Avatar for MyRedz

Your question highlights some gaps in your understanding in the statistics area. As phrased at the moment the answer is no it is not possible but perhaps you could be clearer. The data structure just contain data and are mathematically approximately just vectors [QUOTE=MyRedz;1158268] i was wondering. of all the …

Member Avatar for tetron
0
195
Member Avatar for aianne

I am assume that the code that you have provided was a retype as it would not run. [icode]using namespace std;[/icode] is the minor issue the bigger concern is that your [icode]if[/icode] blocks are out of sync. I would recommend that you always nest your if blocks with [icode]{}[/icode] this …

Member Avatar for tetron
0
244
Member Avatar for Sune

With operator overloading just think of it as a function. You need to decide: 1 - do you need this function now? 2 - what is an appropriate name for what it does 3 - how to write the function 4 - is this the correct place to have the …

Member Avatar for tetron
0
220
Member Avatar for D4n1sD

You want to read up about game engines and you will find that there are several options that would allow you to start very quickly. If you are using visual studio and windows the trickiest bit is creating the window and understanding what messages are about. Now although versions of …

Member Avatar for CodyOebel
0
128
Member Avatar for tkud

I assume that you are asking this question for a windows system which won't let you create a directory from [icode]fstream[/icode] so you need [CODE] #include <windows> int main() { std::string folder("C:\\my_folder"); CreateDirectory(folder.c_str(), NULL); return 0; } [/CODE] The Null is for the security settings which might let you lock …

Member Avatar for tetron
0
130

The End.