Posts
 
Reputation
Joined
Last Seen
Ranked #3K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
54% Quality Score
Upvotes Received
55
Posts with Upvotes
45
Upvoting Members
30
Downvotes Received
59
Posts with Downvotes
38
Downvoting Members
22
32 Commented Posts
~95.3K People Reached
About Me

I live in Romania somewhere near Bucharest.I'm currently working as a cinema projectionst.

Interests
D&D,RPG,RTS,TBS games and of course .. programming
PC Specs
Windows Xp Sp3 using Borland 5.5 C++ and MinGW compilers.Linux Mint 11.
Favorite Forums
Favorite Tags

201 Posted Topics

Member Avatar for Tomi1988

Try creating a new Pig ;)).First declare a pointer to a pig like this [code]Pig* Oliver[/code].Then assign a new Pig () to it like this.[code]Oliver=new Pig();[/code].When you're done feeding and killing him ;)) delete de poor pig from memory.[code]delete Oliver;[/code].And maybe you should join PETA ..

Member Avatar for S_915
0
5K
Member Avatar for Violet_82

I couldn't find your problem but as a suggestion i'd say you should focus more on how you structure your program so that you eliminate much of the overhead by breaking the design in more pieces of functionality.The code becomes more readable and more easy to modify that way.I wrote …

Member Avatar for yaer
0
3K
Member Avatar for restrictment

[code] #include <iostream> #include <cmath> #include <sstream> int pth (int x,int y) { return std::sqrt (std::pow(x,2)+std::pow(y,2)); } int main (int argc,char* argv[]) { int c=0; int r; std::istringstream i(argv[1]); i >> r; const int width=r; const int length=r*1.5; for (int y=width;y >= -width;y-=2) { for (int x=-length;x <= length;x++) { …

Member Avatar for CharlieCap
2
2K
Member Avatar for pittdaniweb

I too am looking for a job:">. Is this the idea? (I don't know assembly too well) For loop: [code] for (int x=0;(x*2)<100;x++) {} mov eax, 0 @head: ;;loop body inc eax imul 2 cmp eax, 100 ja @end jmp @head @end: [/code] While loop: [code] int x=5; while (x) …

Member Avatar for rajii93
0
813
Member Avatar for Kirielson

[code] ifstream in; in.open("filename",std::ios::app); in.seekg(in.tellg(),std::ios::end);//this places the file pointer at the end [/code]

Member Avatar for ankit1990rana
0
8K
Member Avatar for XerX

[code] #include <iostream> #include <vector> #include <math> using namespace std; struct point { int x;int y; point () {} point (int a,int b) : x(a) , y(b) {} friend float dist (point a,point b) { int p1; int p2; (a.x>b.x) ? p1=a.x-b.x : p1=b.x-a.x; (a.y>b.y) ? p2=a.y-b.y : p2=b.y-a.y; return …

Member Avatar for Bob
0
637
Member Avatar for freedomflyer

Deleting the root of a tree won't free the memory allocated for the other nodes. You will lose ownership of the memory allocated by disowning the other left and right pointers. Doing this [code] int* y=new int(5); y=new int(6); //lost ownership of (new int(5)) [/code] will create a memory leak. …

Member Avatar for mike_2000_17
0
594
Member Avatar for triumphost

The postfix increment operator returns the current value after which it increments it but you still get a 5. Try the prefix operator to see the difference.

Member Avatar for mike_2000_17
0
318
Member Avatar for ruval002

You need specify each file's dependencies and the way they are built. //11.o's recipee 11.o : 11.c 11.h $(CC) $(CFLAGS) $< -o $@ //main.o's recipee main.o : main.c $(CC) $(CFLAGS) $< -o $@ //and finally the main program all : main.o 11.o $(CC) $? -o main_proj.exe

Member Avatar for caut_baia
0
170
Member Avatar for im abcd

Your formula needs to be computed inside a function so at line 11 you have a big error as you are trying to initialize an integer variable with the result of an operation of three other uninitialized variables. [code] //ex float density(float mass,float volume) { return mass/volume; } [/code]

Member Avatar for im abcd
0
266
Member Avatar for vic s

[code] #include<stdio.h> #include<stdlib.h> void doTaskA(){ printf("Start of Task A\n\n"); int input_1, input_2, input_3; printf("Start of TASK A\n\n"); printf("Please enter 3 integer.\n"); scanf("%d\n%d\n%d",&input_1, &input_2, &input_3); if ((input_3>input_1) && (input_3>input_2)) printf("/nThe biggest number is %d\n", input_3); else if ((input_2>input_1) && (input_2>input_3)) printf("/nThe biggest number is %d\n", input_2); else printf("/nThe biggest number is …

Member Avatar for vic s
0
187
Member Avatar for tformed

[code] #include <iostream> #include <deque> #include <string> #include <limits> #include <sstream> #include <iomanip> #include <cmath> /* Obtaining square root using the decimimal method */ class square_root { double result,tmp,rmndr; long input; double decim; //Will contain the number of trailing decimimals. std::deque<double> tokens; //Will contain the tokenized 'input' value. square_root (); …

Member Avatar for mikrosfoititis
0
1K
Member Avatar for caut_baia

Hi everyone.I'm trying to compile a resource file ".rc" for a Win32 application but i'm getting this error "use "" to put " in a string".Among other things , i'm trying to define a MENUITEM with a string that looks like this "&Save\t\"Alt+S\"".i have tried escaping the '"' character with …

0
151
Member Avatar for caut_baia

Hi.I get the following error "g++: error: CreateProcess no such file or directory" whenever i try to compile a program.I have installed the MinGw 7.2 version at work on a windows machine and the problem does not occur , however after installing windows SP3 on my home computer i get …

0
218
Member Avatar for totalanonymity

You are redeclaring 'x' and 'y'.They have already been declared in the argument list so in lines 37 and 38 you should just assign to those variables and lose the 'double' specifier.

Member Avatar for WaltP
0
3K
Member Avatar for caut_baia

Hello.I've been looking for a free C++ compiler for windows which supports the new standard features but i had little luck so far.Does someone have any knowledge of one? Thank you in advance.

Member Avatar for caut_baia
0
442
Member Avatar for alle

The error is in function Delete_Font where ADC is an argument of type HBRUSH instead of HDC.

Member Avatar for amyuni
0
558
Member Avatar for owenransen

I think that in the conditional expression the 8 bits variable gets promoted to a 16 bits wchar_t.

Member Avatar for owenransen
0
3K
Member Avatar for crapgarden

Enumerations are constant expressions with static duration which means they cannot be modified during runtime.The declaration [code] enum foxtrot {green, yellow, red}; [/code] is equivalent with [code] typedef enum {green,yellow,red} foxtrot; [/code] in which case you are creating an alias for each enumeration's type.You need an explicit cast (type conversion) …

Member Avatar for ashishseo
0
208
Member Avatar for efigen

[CODE] #include <iostream> #include <fstream> int main () { std::ifstream file("asd.txt"); std::ofstream resfile("dsa.txt"); int x=0; int result=0; char sign='+'; while (!file.eof() && !file.fail()) { file >> x; file >> sign; if (sign=='+') { result+=x; } else break; } resfile << result; resfile.close(); file.close(); } [/CODE]

Member Avatar for WaltP
0
152
Member Avatar for Coffee_Table
Member Avatar for kutuup

I've had this issue once.You need to rerun the configuration batch file (.bat | .cmd) situated in the bin\ directory.

Member Avatar for kutuup
0
674
Member Avatar for coolbeanbob
Member Avatar for caut_baia

Hi.Someone asked a day or two ago for a way to extract the square root of a number without using the std::sqrt function so i thought about writing my own.Here it is and please feel free to criticize.

Member Avatar for maninaction
0
412
Member Avatar for jerryvdk

You need to initialize an OPENFILENAME structure which defines a dialog box.A call to GetOpenFileName() with the required arguments will create the dialog box.Look that up on msdn.

Member Avatar for caut_baia
-1
82
Member Avatar for thecoolman5

[code] std::string asd="234+34"; char plus; int first,second; std::stringstream (asd) >> first >> plus >> second; [/code]

Member Avatar for thecoolman5
0
344
Member Avatar for zhackon

You could start off by creating a class say 'Worker' which would represent specific data like name,weekly hours,untaxed wage etc.Then a class Payslip who's constructor takes a worker as an argument and applies taxes and subtracts social contributions emitting a list of all the operations being done and the total …

Member Avatar for zhackon
0
312
Member Avatar for marvolo1300

You need a pair of brackets even if you don't provide arguments for a function. ;)

Member Avatar for marvolo1300
0
96
Member Avatar for PratikM

[URL="http://homepage.mac.com/guyf/DnD/DnDRulesFAQ.html"]http://homepage.mac.com/guyf/DnD/DnDRulesFAQ.html[/URL]

Member Avatar for pseudorandom21
0
115
Member Avatar for caut_baia

Hi.I have a piece of code that compiles without even a warning on the borland 5.5 compiler yet complains bitterly when compiling with g++.I've heard that g++ emits more portable code but shouldn't they both be standard compliant?From what i've read in the '98 standard book this should be legal …

Member Avatar for mike_2000_17
0
632
Member Avatar for 4everct01

Extended initializer lists are only available with C++0x.Maybe you should assign each element by directly indexing it[code] userInput[0]=user[5]; userInput[1]=user[6]; [/code]

Member Avatar for 4everct01
0
1K
Member Avatar for senergy

You need to send the edit control an WM_GETTEXT message and pass ca C string as the WPARAM argument along with the size of the string in the LPARAM arg.The string pointed to by the WPARAM parameter will receieve the text contained by that edit control.

Member Avatar for caut_baia
0
360
Member Avatar for SETHU S

[URL="http://www.codeproject.com/KB/office/BasicExcel.aspx"]http://www.codeproject.com/KB/office/BasicExcel.aspx[/URL]

Member Avatar for Tomtommitom
0
124
Member Avatar for IndianaRonaldo

The window doesn't get the input focus in case of a WM_PAINT message rather it invalidates a specific region of itself and redraws it ( like when you drag another window on and off the surface of your main window ) or draws the specific child windows that are created …

Member Avatar for caut_baia
0
138
Member Avatar for triumphost

You need owner draw buttons.That means you have to create the necessary shapes or bitmaps to resemble each state of a button.There is a style for this which you pass as an argument in the CreateWindowEx function(BS_OWNERDRAW) but the part of drawing each state in case of a WM_COMMAND message …

Member Avatar for Tellalca
0
147
Member Avatar for dilequeno
Member Avatar for sergent
Member Avatar for sergent
1
274
Member Avatar for Sonia11

This is just so you can get the idea.You should use higher constructs like strings vectors and stringstreams. [code] #include <cctype> #include <cstdio> int main () { char arr[]={"@@123124125@@@"}; int packcount=0; int lettercount=0; char pack[10][3]={0}; for (int x=0;x<sizeof(arr);x++) { if (std::isdigit(arr[x])) { pack[packcount][lettercount]=arr[x]; lettercount++; } if (lettercount==3) { packcount++; lettercount=0; …

Member Avatar for TrustyTony
0
125
Member Avatar for triumphost

If you use visual studio the structure of the program will already be created.A program must register a CREATESTRUCT structure in which you initialize a pointer the main window procedure and several other mandatory variables.Then the class is registered through the RegisterClassEx function.Then the window gets created with the CreateWindowEx …

Member Avatar for caut_baia
0
138
Member Avatar for munitjsr2

1) You sure can but they must be initialized thus declared static [code] class A { static const asd=10; }; [/code] 2) A friend function gains access to private or protected data members of a class.It must be declared in the body of the class's declaration and does not receive …

Member Avatar for kanuxy
-2
185
Member Avatar for perfectBing

Your get_it() function should only act as an accessor and you need a static instance of the class not just a pointer. [code] class A { static A b; A () {} public: ~A () {} static A Get ( { return b; } }; int main () { A::Get(); …

Member Avatar for alwaysLearning0
0
85
Member Avatar for Valiantangel

It is a conditional statement of the form [(boolean expression evaluation) ? (execution in case of true) : (execution in case of false)].Much like an if else statement.In this particular case if (hour<10) will evaluate to true a "0" will be inserted first in the cout stream and a "" …

Member Avatar for Narue
0
167
Member Avatar for Lyandor

If you created the dialog using the CreateDialog function the last function argument should be a pointer to the callback function CalculatorProc.Don't forget to modify that too.

Member Avatar for caut_baia
0
176
Member Avatar for caut_baia

Hi guys.Does anyone who studied the implementation of stringstreams know if : [code] char c; std::stringstream ss; ss << std::fstream ("file.xml",std::ios::in).rdbuf();//this is eqaul in terms of speed while (ss.get(c)) {} //with this? std::ifstream f("file.xml"); while (f.get(c)) {} //or this? [/code] Thanks a lot.

Member Avatar for caut_baia
1
109
Member Avatar for luisFilipe

Much simpler : [code] #include <iostream> #include <sstream> #include <string> #include <fstream> class Item { std::string Name; int Qty; int Price; public: Item (std::string Name_,int Qty_,int Price_) : Name(Name_),Qty(Qty_),Price(Price_) {} Item () {} ~Item () {} friend std::istream& operator >> (std::istream& i,Item& it) { return i >> it.Name >> it.Qty …

Member Avatar for caut_baia
0
94
Member Avatar for localp

Or much more simple you could create a main win32 project and not define or register a window class: [code] int __stdcall WInMain (HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR szCmdArg,INT nCmdShow) { //code here MessageBox (NULL,"Output",NULL,MB_OK); //output stuff } [/code]

Member Avatar for Ancient Dragon
0
396
Member Avatar for nocloud

First of all you should provide a default constructor for your class as for the error you're getting you should take a better look at your initialization list keeping in mind that you should provide valid arguments for the constructors of the classes you are inheriting from.

Member Avatar for caut_baia
0
384
Member Avatar for caut_baia

Did someone reset the down votes for bad membmers ?:D If not .. i'd like to thank whoever got me rid of all those -33 down votes received since i've been a member here.Otherwise if it's a mistake maybe i should get them back since it helped me remind myself …

Member Avatar for caut_baia
1
171
Member Avatar for Trepach

You need a handle to a device context since GetPixel needs one as it's first argument.It returns a COLORREF object which consists of the amount of red green and blue that give the pixel it's color.

Member Avatar for Trepach
0
421
Member Avatar for ThrustinDuffman

isdigit(char) returns a boolean value indicating whether the argument recieved was numeric or else.You must include <cctype> in order to use this function.

Member Avatar for Narue
0
91

The End.