• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 08:55
CEST 14:55
KST 21:55
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL22] Ro8 Preview: In A Tizzy11[ASL22] Ro16 Preview: Holy Diver5[ASL22] Ro16 Preview: Rough Waters10[ASL22] Ro24 Preview: Siren's Call8[ASL22] Ro24 Preview: Summer's End9
Community News
Weekly Cups (Sep 13-20): herO scores triple2BSL Season 2313Weekly Cups (Sep 7-12): SHIN, ByuN, MaxPax double down1StarCraft open world shooter announced at BlizzCon101Weekly Cups (Aug 30-Sep 7): herO thrives amid growing schism10
StarCraft 2
General
How do you feel about the StarCraft shooter announcement at BlizzCon 2026? Balance hotfix patch 5.0.16b (July 16) Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Weekly Cups (Sep 13-20): herO scores triple The Death of Cheese: From a Professional Cheeser
Tourneys
2026 GSTL Grand Finals ScienceCraft (October 24-25) - Live Event Sparkling Tuna Cup - Weekly Open Tournament Master Swan Open (Global Bronze-Master 2) Stellar Fest TWO the Moon (Dec 16-20)
Strategy
[H] ZvP Mid-Late Game: Stalkers Collossi HT
Custom Maps
[M] (2) Sweltering Sands [M] (2) Frigid Storage
External Content
Mutation # 544 Double Trouble The PondCast: SC2 News & Results Mutation # 543 Enhanced Defenses Mutation # 542 The Ascended
Brood War
General
Bot on ladder StarCraft Human 'N' AI League BW General Discussion an AI researcher's take on the ladder bot BSL Season 23
Tourneys
[Megathread] Daily Proleagues [ASL22] Ro8 Day 2 [ASL22] Ro8 Day 1 [IPSL] IPSL is Back With Winter 26-27!
Strategy
Cliff Jump Revisited (1 in a 1000 strategy) Replay Review Process - What do you do? Simple Questions, Simple Answers Odyssey Mineral Stack Saturation
Other Games
General Games
Warcraft III: The Frozen Throne Stormgate/Frost Giant Megathread Nintendo Switch Thread EVE Corporation Diablo IV
Dota 2
Dota 2 Champions League Season 3 Begins April 25! Official 'what is Dota anymore' discussion
League of Legends
[TL LoL EUW IHs] Teemo shall perish
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Artificial Intelligence Thread All you football fans (soccer)!
Fan Clubs
MarineLorD Fan Club The Creator Fan Club The ShoWTimE Fan Club
Media & Entertainment
Movie Discussion! [Manga] One Piece Diablo Animated Series on Netflix
Sports
Football (Soccer) Thread
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Recent Gifted Posts
Blogs
Violent-Cooperative Play and…
TrAiDoS
38 yo Retired SWE loo…
PurE)Rabbit-SF
Can Bots Beat Pros?? Starcr…
namkraft
[meme] I finally understa…
LUCKY_NOOB
Regacy Esports:Our Goa…
regacyesports
Customize Sidebar...

Website Feedback

Closed Threads



Active: 8016 users

The Big Programming Thread - Page 196

Forum Index > General Forum
Post a Reply
Prev 1 194 195 196 197 198 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
Craton
Profile Blog Joined December 2009
United States17303 Posts
Last Edited: 2012-11-15 22:53:37
November 15 2012 22:50 GMT
#3901
I return with JDeveloper questions:

Inside JDeveloper you can run a few steps to export either an offline database or the objects inside a database diagram (in the latter case, you're basically taking a subset of that offline database) to an existing database. That is, you can instantly replicate what you have done in your offline project onto an actual database.

Is there a way to externally call this process, such as via a batch script or Ruby? Simply generating the SQL script remotely would be fine. I'm basically just looking for a way to ultimately spin this process off from a C#.NET application without needing to first load up JDeveloper and manually export the SQL script.
twitch.tv/cratonz
EsX_Raptor
Profile Blog Joined February 2008
United States2802 Posts
November 16 2012 01:15 GMT
#3902
I'm a computer scientist since 2010, and I never understood two things about the C++ language: what does using namespace std; do? What exactly does the static keyword do? I will now go hide in shame.
meatpudding
Profile Joined March 2011
Australia520 Posts
November 16 2012 01:27 GMT
#3903
On November 16 2012 02:56 Nausea wrote:
Show nested quote +
On November 16 2012 00:15 Nausea wrote:
On November 16 2012 00:05 Bigpet wrote:
On November 15 2012 23:47 Nausea wrote:
On November 15 2012 23:39 netherh wrote:
On November 15 2012 22:59 Nausea wrote:
+ Show Spoiler +
On November 15 2012 22:45 Bigpet wrote:
Show nested quote +
On November 15 2012 22:22 Nausea wrote:
+ Show Spoiler +
On November 15 2012 22:07 Schokomuesli wrote:
Just to get it right... What you are doing is:

{
(...)
C_Player player;
Shade.OnLoad(&player, 0.5f);
(...)
}

and inside Shade.OnLoad() you copy a value in player to a local variable in Shade, right? Furthermore: is the pointer you passed into OnLoad still valid when using it? In particular: do you use if after leaving the scope in which you created player (that is: the closing curly brace just below OnLoad ^)? Because after this brace, player does not exist anymore if you create it on the stack as you did in the example above...

If you do _excatly_ this:

{
C_Player player;
Shade.OnLoad(&player, 0.5f);
}

^and never again use anything inside Shade which refers to the pointer you passed you are fine and all of this should work.

If you do this:

{
{
C_Player player;
C_Player* player2 = new C_Player();
Shade.OnLoad(&player, 0.5f);
Shade.OnLoad(player2, 0.5f);
}
Shade.asdf1(); // asdf1 uses the pointer to player you passed /w onLoad before - this breaks
Shade.asdf2(); // asdf2 uses the pointer to player2 you passed /w onLoad before - this works because due to heap construction, the object player2 points to still exists...
}

This will not work... player does not exist anymore but you still have the adress where it used to reside before leaving the scope you created it in.

BTW, this is just guesswork without seeing the methods and the surrounding code...


Thanks, but C_Player player is from C_Application.h and then implemented inside applications OnInit funktion. This should lead player to "die" at the end of the program, like every entity in my entitylist. I have tried making player dynamic, this did not work either. This is why I am confused atm.


Then what exactly is strange in your program then? Explaining it in words is kind of hard to understand. You should post some code example. Btw. if your problem is that the pointer is slightly offset then that may be due to multiple inheritance if you use that. Don't let us puzzle, post a self contained example.


#include <iostream>

class Base{public: long padding;};
class Base2{};
class Derived : public Base, public Base2{};

int main(){
Derived d;
Derived *ptr = &d;
Base2 *bas = static_cast<Base2 *>(ptr);
if((void *)ptr != (void *)bas){
std::cout << "the wonders of multiple inheritance" << std::endl;
}
return 0;
}


Ok, here goes then. Adding some example code to show you what is happening.

+ Show Spoiler +
C_Application.h


class C_Application : public C_Event {

private:
C_Player player;

(...)

};



C_Application.cpp


bool C_Application::OnInit()
{

player.OnLoad("player.png", 0, 0);

C_PlayerShade* shadeptr = new C_Shade;

shadeptr->OnLoad(&player, 0.5);

(...)

}


C_Player inherits C_Entity, C_PlayerShade inherits C_Entity.

C_PlayerShade.h


class C_PlayerShade : public C_Entity {

private:
C_Entity* parentptr;

public:
bool OnLoad(C_Entity* parent, float delay);

(...)

}



C_PlayerShade.cpp


bool C_PlayerShade::OnLoad(C_Entity* parent, float delay)
{

parentptr = parent;

this->X = parentptr->X; // Does not work. Gives wrong value.

}



Hope that helps, If you want to know more let me know.



I think we might need to see C_Player and C_Entity and where / how you set the value of X to be certain what's going on.

It's possible that you're defining X in both the player and entity class, and only set the value in the player class. Then when you try to fetch it from your entity pointer, you get the value of X from the entity class, and not the player class. But that's just a guess without seeing the other things.


The X var is only defined in C_Entity, neither C_Player or C_PlayerShade defines it, they just use it through C_Entity.


Whatever the problem is, it doesn't appear to originate in the snippets you posted, have you tried setting breakpoints and checking the value of the member X at different points (mainly before and after passing the pointer to OnLoad)?


Well I will have to code it again since I decided to remove it yesterday after hours of trial and error and memory errors making my computer wanna kill itself, so I ended up restarting my computer and reverting all that stuff.


If anyone want to take a look and see if something looks glaringly wrong, please do so.

+ Show Spoiler +
class C_Entity {

public:
static std::vector<C_Entity*> EntityList;

C_Animation Anim_Control;

protected:


SDL_Surface* Surf_Entity;

public:
float X;
float Y;
(...)


#include "C_Entity.h"

std::vector<C_Entity*> C_Entity::EntityList;

C_Entity::C_Entity()
{

Surf_Entity = NULL;

X = 0;
Y = 0;

Width = 0;
Height = 0;

MoveLeft = false;
MoveRight = false;

Direction = ENTITY_DIRECTION_RIGHT;

Type = ENTITY_TYPE_GENERIC;

Dead = false;
Flags = ENTITY_FLAG_NONE;

SpeedX = 0;
SpeedY = 0;

AccelY = 0;

MaxSpeedX = 13;
MaxSpeedY = 10;

Col_X = 0;
Col_Y = 0;

Col_Width = 0;
Col_Height = 0;
(...)


class C_Player : public C_Entity {

public:

unsigned int LastSlide;
bool Sliding;
bool SlidingRight;
bool SlidingLeft;
bool JumpedOnSlide;

bool CanJump;
bool Jumping;
bool FirstJump;

bool Shooting;
bool ChargeShot;

(...)


C_Player::C_Player()
{

MaxSpeedY = 10.5;
X = 0;
Y = 0;

LastSlide = 0;
Sliding = false;
SlidingRight = false;
SlidingLeft = false;
JumpedOnSlide = false;

CanJump = false;
Jumping = false;
FirstJump = true;

Shooting = false;
ChargeShot = false;

Direction = ENTITY_DIRECTION_RIGHT;
Type = ENTITY_TYPE_PLAYER;
Flags = ENTITY_FLAG_GRAVITY;

Dead = false;

}


class C_PlayerShade : public C_Entity {

private:
C_Entity* target;

float SpeedDelay;

public:
C_PlayerShade();
C_PlayerShade(C_Entity* parent, float delay);
(...)


C_PlayerShade::C_PlayerShade()
{
SpeedX = 0;
SpeedY = 0;
SpeedDelay = 0;

AccelY = 0;

X = 0;
Y = 0;

target = NULL;

Dead = false;

Direction = ENTITY_DIRECTION_RIGHT;
Type = ENTITY_TYPE_PLAYER;
Flags = ENTITY_FLAG_GRAVITY;
}

C_PlayerShade::C_PlayerShade(C_Entity* parent, float delay)
{

target = parent;

AccelY = target->AccelY;

X = target->X;
Y = target->Y;

SpeedX = target->SpeedX;
SpeedY = target->SpeedY;
SpeedDelay = delay;

Dead = false;

Direction = ENTITY_DIRECTION_RIGHT;
Type = ENTITY_TYPE_GENERIC;
Flags = ENTITY_FLAG_GRAVITY;

OnLoad();

}


bool C_PlayerShade::OnLoad()
{


C_Frameset CharJumpRight( "JUMPINGRIGHT" );
CharJumpRight.AddFrame(0, 188, 25, 48);
CharJumpRight.AddFrame(25, 187, 23, 51);
CharJumpRight.AddFrame(48, 189, 23, 55);
CharJumpRight.AddFrame(71, 187, 23, 57);
CharJumpRight.AddFrame(94, 190, 27, 53);
CharJumpRight.AddFrame(121, 191, 34, 50);

C_Frameset CharJumpLeft( "JUMPINGLEFT" );
CharJumpLeft.AddFrame(0, 245, 25, 48);
CharJumpLeft.AddFrame(25, 244, 23, 51);
CharJumpLeft.AddFrame(48, 246, 23, 55);
CharJumpLeft.AddFrame(71, 244, 23, 57);
CharJumpLeft.AddFrame(94, 247, 27, 53);
CharJumpLeft.AddFrame(121, 248, 34, 50);

C_Frameset CharFallRight( "FALLINGRIGHT" );
CharFallRight.AddFrame(155, 190, 32, 52);
CharFallRight.AddFrame(187, 189, 29, 54);

C_Frameset CharFallLeft( "FALLINGLEFT" );
CharFallLeft.AddFrame(155, 247, 32, 52);
CharFallLeft.AddFrame(187, 246, 29, 52);

C_Frameset CharSlideRight( "SLIDINGRIGHT" );
CharSlideRight.AddFrame(0, 301, 34, 44);
CharSlideRight.AddFrame(34, 301, 46, 44, 10);
CharSlideRight.AddFrame(80, 301, 53, 44, 20);
CharSlideRight.AddFrame(133, 301, 57, 44, 20);
CharSlideRight.AddFrame(190, 301, 38, 44, 10);
CharSlideRight.AddFrame(228, 301, 30, 44, 10);
CharSlideRight.AddFrame(258, 301, 41, 44, 10);
CharSlideRight.AddFrame(299, 301, 43, 44, 10);

C_Frameset CharSlideLeft( "SLIDINGLEFT" );
CharSlideLeft.AddFrame(0, 345, 34, 44);
CharSlideLeft.AddFrame(34, 345, 46, 44);
CharSlideLeft.AddFrame(80, 345, 53, 44);
CharSlideLeft.AddFrame(133, 345, 57, 44);
CharSlideLeft.AddFrame(190, 345, 38, 44);
CharSlideLeft.AddFrame(228, 345, 30, 44);
CharSlideLeft.AddFrame(258, 345, 41, 44);
CharSlideLeft.AddFrame(299, 345, 43, 44);

C_Frameset Transparent("TRANSPARENT");
Transparent.AddFrame(500,0,0,0);

Anim_Control.AddFrameset(CharJumpRight);
Anim_Control.AddFrameset(CharJumpLeft);
Anim_Control.AddFrameset(CharFallRight);
Anim_Control.AddFrameset(CharFallLeft);
Anim_Control.AddFrameset(CharSlideRight);
Anim_Control.AddFrameset(CharSlideLeft);
Anim_Control.AddFrameset(Transparent);

Anim_Control.SetAnimation("TRANSPARENT",150);

if(C_Entity::OnLoad("./gfx/megaman/shade.png") == false)
{
fprintf(stderr, "Failed to load shade.png: %s\n", SDL_GetError());
return false;
}

X = target->X;
Y = target->Y;

SpeedX = target->SpeedX;
SpeedY = target->SpeedY;

AccelY = target->AccelY;

return true;


}



You should use accessor methods instead of public member variables. That's just asking for trouble. Also I'm concerned about the possibility of null pointers in the OnLoad method. Although a pointer to a deleted object is just as bad or worse :/
Be excellent to each other.
Bigpet
Profile Joined July 2010
Germany533 Posts
Last Edited: 2012-11-16 02:55:41
November 16 2012 02:52 GMT
#3904
On November 16 2012 10:15 EsX_Raptor wrote:
I'm a computer scientist since 2010, and I never understood two things about the C++ language: what does using namespace std; do? What exactly does the static keyword do? I will now go hide in shame.


using namespace std; imports the namespace "std" into your current namespace, so that you can write

#include <string>
#include <iostream>

int main(int argc, char **argv)
{
{
using namespace std;
string s = string("this be text");
cout << s << endl;
}
//string s2; //<---this would result in a compile error, string is unknown here, it's std::string
{
std::string s = std::string("this be text");
std::cout << s << std::endl;
}
}


As for static ho boy, where do I begin, I guess "make this value constant across the whole program"


int increment(){
static int f=0; //initialization will only be run the first time
return ++f;
}

class A{
public:
int a; //this isn't static and each instance of A will have its own int a
static int b;//this will exist globally and have the same value for all instances of A
static void function(){
//a++; //this is a compile error, a does not exist in a static context
b++;
}
};

int A::b=1;//initialize the static value

int main(int argc, char **argv){
increment();//returns 1
increment();//returns 2, etc for successive calls

A::function(); //call function and set A::b to 2, we don't need and instance of A to call this because it's a static function
A::b=7;//we can also access static data members without instantiating A
//A::a; // compile error, a is a non-static member , we need an instance of A

A obj;
obj.function();//increases A::b from 7 to 8
//there's no difference between obj.function() and A::function()
obj.a=5;

}


This is the shortest way in which I can describe those concepts.
I'm NOT the caster with a similar nick
Craton
Profile Blog Joined December 2009
United States17303 Posts
November 16 2012 03:00 GMT
#3905
On November 16 2012 10:15 EsX_Raptor wrote:
I'm a computer scientist since 2010, and I never understood two things about the C++ language: what does using namespace std; do? What exactly does the static keyword do? I will now go hide in shame.

What is your definition of "being a computer scientist?" Do you mean you started your education in 2010 or that you've been professionally developing for 2 years?
twitch.tv/cratonz
Kambing
Profile Joined May 2010
United States1176 Posts
Last Edited: 2012-11-16 03:09:34
November 16 2012 03:09 GMT
#3906
On November 16 2012 11:52 Bigpet wrote:
Show nested quote +
On November 16 2012 10:15 EsX_Raptor wrote:
As for static ho boy, where do I begin, I guess "make this value constant across the whole program"


int increment(){
static int f=0; //initialization will only be run the first time
return ++f;
}

class A{
public:
int a; //this isn't static and each instance of A will have its own int a
static int b;//this will exist globally and have the same value for all instances of A
static void function(){
//a++; //this is a compile error, a does not exist in a static context
b++;
}
};

int A::b=1;//initialize the static value

int main(int argc, char **argv){
increment();//returns 1
increment();//returns 2, etc for successive calls

A::function(); //call function and set A::b to 2, we don't need and instance of A to call this because it's a static function
A::b=7;//we can also access static data members without instantiating A
//A::a; // compile error, a is a non-static member , we need an instance of A

A obj;
obj.function();//increases A::b from 7 to 8
//there's no difference between obj.function() and A::function()
obj.a=5;

}


This is the shortest way in which I can describe those concepts.



Static in the context of C++ doesn't have anything to do with constant-ness/immutability; that's what const is for. Your examples illustrate what static means, though. Static affects the lifetime of an object in C++ as well as its linkage (i.e., if the value is visible outside of the file). The meaning of static depends on what is being declared static. For example:

+ A global variable marked as static explicitly has internal linkage. That is, the variable (precisely, its name) is not visible outside of the file it is declared in.
+ A field (in a class) marked as static has the same meaning as in Java. That field is shared among all instances of that class.
Craton
Profile Blog Joined December 2009
United States17303 Posts
Last Edited: 2012-11-16 03:13:21
November 16 2012 03:13 GMT
#3907
"Consistent" would be a better term, though it does not entirely cover the meaning.
twitch.tv/cratonz
Bigpet
Profile Joined July 2010
Germany533 Posts
Last Edited: 2012-11-16 03:38:31
November 16 2012 03:14 GMT
#3908
+ Show Spoiler +
On November 16 2012 12:09 Kambing wrote:
Show nested quote +
On November 16 2012 11:52 Bigpet wrote:
On November 16 2012 10:15 EsX_Raptor wrote:
As for static ho boy, where do I begin, I guess "make this value constant across the whole program"


int increment(){
static int f=0; //initialization will only be run the first time
return ++f;
}

class A{
public:
int a; //this isn't static and each instance of A will have its own int a
static int b;//this will exist globally and have the same value for all instances of A
static void function(){
//a++; //this is a compile error, a does not exist in a static context
b++;
}
};

int A::b=1;//initialize the static value

int main(int argc, char **argv){
increment();//returns 1
increment();//returns 2, etc for successive calls

A::function(); //call function and set A::b to 2, we don't need and instance of A to call this because it's a static function
A::b=7;//we can also access static data members without instantiating A
//A::a; // compile error, a is a non-static member , we need an instance of A

A obj;
obj.function();//increases A::b from 7 to 8
//there's no difference between obj.function() and A::function()
obj.a=5;

}


This is the shortest way in which I can describe those concepts.



Static in the context of C++ doesn't have anything to do with constant-ness/immutability; that's what const is for. Your examples illustrate what static means, though. Static affects the lifetime of an object in C++ as well as its linkage (i.e., if the value is visible outside of the file). The meaning of static depends on what is being declared static. For example:

+ A global variable marked as static explicitly has internal linkage. That is, the variable (precisely, its name) is not visible outside of the file it is declared in.
+ A field (in a class) marked as static has the same meaning as in Java. That field is shared among all instances of that class.


Yeah, used the wrong word. I was looking for "consistent across the program" not constant.


Dangit got ninja'd, well mods you might as well delete this post now
I'm NOT the caster with a similar nick
phar
Profile Joined August 2011
United States1080 Posts
November 16 2012 08:13 GMT
#3909
On November 15 2012 23:55 kaykaykay wrote:
Is there anybody decent with Object oriented programing eclipse java here? :D

Depends on your definition of "decent," but yea probably.
Who after all is today speaking about the destruction of the Armenians?
Schokomuesli
Profile Joined November 2010
Germany12 Posts
Last Edited: 2012-11-16 09:29:22
November 16 2012 09:22 GMT
#3910
On November 16 2012 02:56 Nausea wrote:
Show nested quote +
On November 16 2012 00:15 Nausea wrote:
On November 16 2012 00:05 Bigpet wrote:
On November 15 2012 23:47 Nausea wrote:
On November 15 2012 23:39 netherh wrote:
On November 15 2012 22:59 Nausea wrote:
+ Show Spoiler +
On November 15 2012 22:45 Bigpet wrote:
Show nested quote +
On November 15 2012 22:22 Nausea wrote:
+ Show Spoiler +
On November 15 2012 22:07 Schokomuesli wrote:
Just to get it right... What you are doing is:

{
(...)
C_Player player;
Shade.OnLoad(&player, 0.5f);
(...)
}

and inside Shade.OnLoad() you copy a value in player to a local variable in Shade, right? Furthermore: is the pointer you passed into OnLoad still valid when using it? In particular: do you use if after leaving the scope in which you created player (that is: the closing curly brace just below OnLoad ^)? Because after this brace, player does not exist anymore if you create it on the stack as you did in the example above...

If you do _excatly_ this:

{
C_Player player;
Shade.OnLoad(&player, 0.5f);
}

^and never again use anything inside Shade which refers to the pointer you passed you are fine and all of this should work.

If you do this:

{
{
C_Player player;
C_Player* player2 = new C_Player();
Shade.OnLoad(&player, 0.5f);
Shade.OnLoad(player2, 0.5f);
}
Shade.asdf1(); // asdf1 uses the pointer to player you passed /w onLoad before - this breaks
Shade.asdf2(); // asdf2 uses the pointer to player2 you passed /w onLoad before - this works because due to heap construction, the object player2 points to still exists...
}

This will not work... player does not exist anymore but you still have the adress where it used to reside before leaving the scope you created it in.

BTW, this is just guesswork without seeing the methods and the surrounding code...


Thanks, but C_Player player is from C_Application.h and then implemented inside applications OnInit funktion. This should lead player to "die" at the end of the program, like every entity in my entitylist. I have tried making player dynamic, this did not work either. This is why I am confused atm.


Then what exactly is strange in your program then? Explaining it in words is kind of hard to understand. You should post some code example. Btw. if your problem is that the pointer is slightly offset then that may be due to multiple inheritance if you use that. Don't let us puzzle, post a self contained example.


#include <iostream>

class Base{public: long padding;};
class Base2{};
class Derived : public Base, public Base2{};

int main(){
Derived d;
Derived *ptr = &d;
Base2 *bas = static_cast<Base2 *>(ptr);
if((void *)ptr != (void *)bas){
std::cout << "the wonders of multiple inheritance" << std::endl;
}
return 0;
}


Ok, here goes then. Adding some example code to show you what is happening.

+ Show Spoiler +
C_Application.h


class C_Application : public C_Event {

private:
C_Player player;

(...)

};



C_Application.cpp


bool C_Application::OnInit()
{

player.OnLoad("player.png", 0, 0);

C_PlayerShade* shadeptr = new C_Shade;

shadeptr->OnLoad(&player, 0.5);

(...)

}


C_Player inherits C_Entity, C_PlayerShade inherits C_Entity.

C_PlayerShade.h


class C_PlayerShade : public C_Entity {

private:
C_Entity* parentptr;

public:
bool OnLoad(C_Entity* parent, float delay);

(...)

}



C_PlayerShade.cpp


bool C_PlayerShade::OnLoad(C_Entity* parent, float delay)
{

parentptr = parent;

this->X = parentptr->X; // Does not work. Gives wrong value.

}



Hope that helps, If you want to know more let me know.



I think we might need to see C_Player and C_Entity and where / how you set the value of X to be certain what's going on.

It's possible that you're defining X in both the player and entity class, and only set the value in the player class. Then when you try to fetch it from your entity pointer, you get the value of X from the entity class, and not the player class. But that's just a guess without seeing the other things.


The X var is only defined in C_Entity, neither C_Player or C_PlayerShade defines it, they just use it through C_Entity.


Whatever the problem is, it doesn't appear to originate in the snippets you posted, have you tried setting breakpoints and checking the value of the member X at different points (mainly before and after passing the pointer to OnLoad)?


Well I will have to code it again since I decided to remove it yesterday after hours of trial and error and memory errors making my computer wanna kill itself, so I ended up restarting my computer and reverting all that stuff.


If anyone want to take a look and see if something looks glaringly wrong, please do so.

+ Show Spoiler +
class C_Entity {

public:
static std::vector<C_Entity*> EntityList;

C_Animation Anim_Control;

protected:


SDL_Surface* Surf_Entity;

public:
float X;
float Y;
(...)


#include "C_Entity.h"

std::vector<C_Entity*> C_Entity::EntityList;

C_Entity::C_Entity()
{

Surf_Entity = NULL;

X = 0;
Y = 0;

Width = 0;
Height = 0;

MoveLeft = false;
MoveRight = false;

Direction = ENTITY_DIRECTION_RIGHT;

Type = ENTITY_TYPE_GENERIC;

Dead = false;
Flags = ENTITY_FLAG_NONE;

SpeedX = 0;
SpeedY = 0;

AccelY = 0;

MaxSpeedX = 13;
MaxSpeedY = 10;

Col_X = 0;
Col_Y = 0;

Col_Width = 0;
Col_Height = 0;
(...)


class C_Player : public C_Entity {

public:

unsigned int LastSlide;
bool Sliding;
bool SlidingRight;
bool SlidingLeft;
bool JumpedOnSlide;

bool CanJump;
bool Jumping;
bool FirstJump;

bool Shooting;
bool ChargeShot;

(...)


C_Player::C_Player()
{

MaxSpeedY = 10.5;
X = 0;
Y = 0;

LastSlide = 0;
Sliding = false;
SlidingRight = false;
SlidingLeft = false;
JumpedOnSlide = false;

CanJump = false;
Jumping = false;
FirstJump = true;

Shooting = false;
ChargeShot = false;

Direction = ENTITY_DIRECTION_RIGHT;
Type = ENTITY_TYPE_PLAYER;
Flags = ENTITY_FLAG_GRAVITY;

Dead = false;

}


class C_PlayerShade : public C_Entity {

private:
C_Entity* target;

float SpeedDelay;

public:
C_PlayerShade();
C_PlayerShade(C_Entity* parent, float delay);
(...)


C_PlayerShade::C_PlayerShade()
{
SpeedX = 0;
SpeedY = 0;
SpeedDelay = 0;

AccelY = 0;

X = 0;
Y = 0;

target = NULL;

Dead = false;

Direction = ENTITY_DIRECTION_RIGHT;
Type = ENTITY_TYPE_PLAYER;
Flags = ENTITY_FLAG_GRAVITY;
}

C_PlayerShade::C_PlayerShade(C_Entity* parent, float delay)
{

target = parent;

AccelY = target->AccelY;

X = target->X;
Y = target->Y;

SpeedX = target->SpeedX;
SpeedY = target->SpeedY;
SpeedDelay = delay;

Dead = false;

Direction = ENTITY_DIRECTION_RIGHT;
Type = ENTITY_TYPE_GENERIC;
Flags = ENTITY_FLAG_GRAVITY;

OnLoad();

}


bool C_PlayerShade::OnLoad()
{


C_Frameset CharJumpRight( "JUMPINGRIGHT" );
CharJumpRight.AddFrame(0, 188, 25, 48);
CharJumpRight.AddFrame(25, 187, 23, 51);
CharJumpRight.AddFrame(48, 189, 23, 55);
CharJumpRight.AddFrame(71, 187, 23, 57);
CharJumpRight.AddFrame(94, 190, 27, 53);
CharJumpRight.AddFrame(121, 191, 34, 50);

C_Frameset CharJumpLeft( "JUMPINGLEFT" );
CharJumpLeft.AddFrame(0, 245, 25, 48);
CharJumpLeft.AddFrame(25, 244, 23, 51);
CharJumpLeft.AddFrame(48, 246, 23, 55);
CharJumpLeft.AddFrame(71, 244, 23, 57);
CharJumpLeft.AddFrame(94, 247, 27, 53);
CharJumpLeft.AddFrame(121, 248, 34, 50);

C_Frameset CharFallRight( "FALLINGRIGHT" );
CharFallRight.AddFrame(155, 190, 32, 52);
CharFallRight.AddFrame(187, 189, 29, 54);

C_Frameset CharFallLeft( "FALLINGLEFT" );
CharFallLeft.AddFrame(155, 247, 32, 52);
CharFallLeft.AddFrame(187, 246, 29, 52);

C_Frameset CharSlideRight( "SLIDINGRIGHT" );
CharSlideRight.AddFrame(0, 301, 34, 44);
CharSlideRight.AddFrame(34, 301, 46, 44, 10);
CharSlideRight.AddFrame(80, 301, 53, 44, 20);
CharSlideRight.AddFrame(133, 301, 57, 44, 20);
CharSlideRight.AddFrame(190, 301, 38, 44, 10);
CharSlideRight.AddFrame(228, 301, 30, 44, 10);
CharSlideRight.AddFrame(258, 301, 41, 44, 10);
CharSlideRight.AddFrame(299, 301, 43, 44, 10);

C_Frameset CharSlideLeft( "SLIDINGLEFT" );
CharSlideLeft.AddFrame(0, 345, 34, 44);
CharSlideLeft.AddFrame(34, 345, 46, 44);
CharSlideLeft.AddFrame(80, 345, 53, 44);
CharSlideLeft.AddFrame(133, 345, 57, 44);
CharSlideLeft.AddFrame(190, 345, 38, 44);
CharSlideLeft.AddFrame(228, 345, 30, 44);
CharSlideLeft.AddFrame(258, 345, 41, 44);
CharSlideLeft.AddFrame(299, 345, 43, 44);

C_Frameset Transparent("TRANSPARENT");
Transparent.AddFrame(500,0,0,0);

Anim_Control.AddFrameset(CharJumpRight);
Anim_Control.AddFrameset(CharJumpLeft);
Anim_Control.AddFrameset(CharFallRight);
Anim_Control.AddFrameset(CharFallLeft);
Anim_Control.AddFrameset(CharSlideRight);
Anim_Control.AddFrameset(CharSlideLeft);
Anim_Control.AddFrameset(Transparent);

Anim_Control.SetAnimation("TRANSPARENT",150);

if(C_Entity::OnLoad("./gfx/megaman/shade.png") == false)
{
fprintf(stderr, "Failed to load shade.png: %s\n", SDL_GetError());
return false;
}

X = target->X;
Y = target->Y;

SpeedX = target->SpeedX;
SpeedY = target->SpeedY;

AccelY = target->AccelY;

return true;


}




^^sorry, in a bit of an hurry but I saw one thing: you might want to start using initialization Lists for your constructors - this yields less unnecessary constructor calls.
Example:

class A {
public:
A(int i, const Widget& w);
private:
int m_i;
Widget m_widget;
};

(...)

Constructors:
Option 1:
A::A(int i, const Widget& w)
: m_i(i),
m_widget(w)
{}

Option 2:
A::A(int i, const Widget& w)
{
m_i = i;
m_widget = w;
}


- Constructing A using Option 1 yields two constructor calls (copy constructors both, once for m_i, once for m_widget. Those occur in place where they are needed, that is: no copying involved.

- Constucting A using Option 2 yields four constructor/method calls (default constructors for both m_i and m_widget and then assignment (most likely involving copying stuff between memory locations)).

Otherwise, the code behaves exactly the same, so there is no need to do it like this :-) (Btw: if you do so, do it in order, so that if m_i is declared before m_widget, use that order in initialization. Makes it easier on the caches if you do not need to jump between adresses).

C++11 expands on those options, you might want to look into this as well if your compiler supports it... (/edit: here: http://en.wikipedia.org/wiki/C++11#Object_construction_improvement )

And to the guy asking about goto... here is the original article on why goto is considered harmful - written by Dijkstra in 1968:
http://www.u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_Harmful.html
Nausea
Profile Joined October 2010
Sweden807 Posts
Last Edited: 2012-11-16 10:36:49
November 16 2012 10:35 GMT
#3911
On November 16 2012 10:27 meatpudding wrote:
Show nested quote +
On November 16 2012 02:56 Nausea wrote:
On November 16 2012 00:15 Nausea wrote:
On November 16 2012 00:05 Bigpet wrote:
On November 15 2012 23:47 Nausea wrote:
On November 15 2012 23:39 netherh wrote:
On November 15 2012 22:59 Nausea wrote:
+ Show Spoiler +
On November 15 2012 22:45 Bigpet wrote:
Show nested quote +
On November 15 2012 22:22 Nausea wrote:
+ Show Spoiler +
On November 15 2012 22:07 Schokomuesli wrote:
Just to get it right... What you are doing is:

{
(...)
C_Player player;
Shade.OnLoad(&player, 0.5f);
(...)
}

and inside Shade.OnLoad() you copy a value in player to a local variable in Shade, right? Furthermore: is the pointer you passed into OnLoad still valid when using it? In particular: do you use if after leaving the scope in which you created player (that is: the closing curly brace just below OnLoad ^)? Because after this brace, player does not exist anymore if you create it on the stack as you did in the example above...

If you do _excatly_ this:

{
C_Player player;
Shade.OnLoad(&player, 0.5f);
}

^and never again use anything inside Shade which refers to the pointer you passed you are fine and all of this should work.

If you do this:

{
{
C_Player player;
C_Player* player2 = new C_Player();
Shade.OnLoad(&player, 0.5f);
Shade.OnLoad(player2, 0.5f);
}
Shade.asdf1(); // asdf1 uses the pointer to player you passed /w onLoad before - this breaks
Shade.asdf2(); // asdf2 uses the pointer to player2 you passed /w onLoad before - this works because due to heap construction, the object player2 points to still exists...
}

This will not work... player does not exist anymore but you still have the adress where it used to reside before leaving the scope you created it in.

BTW, this is just guesswork without seeing the methods and the surrounding code...


Thanks, but C_Player player is from C_Application.h and then implemented inside applications OnInit funktion. This should lead player to "die" at the end of the program, like every entity in my entitylist. I have tried making player dynamic, this did not work either. This is why I am confused atm.


Then what exactly is strange in your program then? Explaining it in words is kind of hard to understand. You should post some code example. Btw. if your problem is that the pointer is slightly offset then that may be due to multiple inheritance if you use that. Don't let us puzzle, post a self contained example.


#include <iostream>

class Base{public: long padding;};
class Base2{};
class Derived : public Base, public Base2{};

int main(){
Derived d;
Derived *ptr = &d;
Base2 *bas = static_cast<Base2 *>(ptr);
if((void *)ptr != (void *)bas){
std::cout << "the wonders of multiple inheritance" << std::endl;
}
return 0;
}


Ok, here goes then. Adding some example code to show you what is happening.

+ Show Spoiler +
C_Application.h


class C_Application : public C_Event {

private:
C_Player player;

(...)

};



C_Application.cpp


bool C_Application::OnInit()
{

player.OnLoad("player.png", 0, 0);

C_PlayerShade* shadeptr = new C_Shade;

shadeptr->OnLoad(&player, 0.5);

(...)

}


C_Player inherits C_Entity, C_PlayerShade inherits C_Entity.

C_PlayerShade.h


class C_PlayerShade : public C_Entity {

private:
C_Entity* parentptr;

public:
bool OnLoad(C_Entity* parent, float delay);

(...)

}



C_PlayerShade.cpp


bool C_PlayerShade::OnLoad(C_Entity* parent, float delay)
{

parentptr = parent;

this->X = parentptr->X; // Does not work. Gives wrong value.

}



Hope that helps, If you want to know more let me know.



I think we might need to see C_Player and C_Entity and where / how you set the value of X to be certain what's going on.

It's possible that you're defining X in both the player and entity class, and only set the value in the player class. Then when you try to fetch it from your entity pointer, you get the value of X from the entity class, and not the player class. But that's just a guess without seeing the other things.


The X var is only defined in C_Entity, neither C_Player or C_PlayerShade defines it, they just use it through C_Entity.


Whatever the problem is, it doesn't appear to originate in the snippets you posted, have you tried setting breakpoints and checking the value of the member X at different points (mainly before and after passing the pointer to OnLoad)?


Well I will have to code it again since I decided to remove it yesterday after hours of trial and error and memory errors making my computer wanna kill itself, so I ended up restarting my computer and reverting all that stuff.


If anyone want to take a look and see if something looks glaringly wrong, please do so.

+ Show Spoiler +
class C_Entity {

public:
static std::vector<C_Entity*> EntityList;

C_Animation Anim_Control;

protected:


SDL_Surface* Surf_Entity;

public:
float X;
float Y;
(...)


#include "C_Entity.h"

std::vector<C_Entity*> C_Entity::EntityList;

C_Entity::C_Entity()
{

Surf_Entity = NULL;

X = 0;
Y = 0;

Width = 0;
Height = 0;

MoveLeft = false;
MoveRight = false;

Direction = ENTITY_DIRECTION_RIGHT;

Type = ENTITY_TYPE_GENERIC;

Dead = false;
Flags = ENTITY_FLAG_NONE;

SpeedX = 0;
SpeedY = 0;

AccelY = 0;

MaxSpeedX = 13;
MaxSpeedY = 10;

Col_X = 0;
Col_Y = 0;

Col_Width = 0;
Col_Height = 0;
(...)


class C_Player : public C_Entity {

public:

unsigned int LastSlide;
bool Sliding;
bool SlidingRight;
bool SlidingLeft;
bool JumpedOnSlide;

bool CanJump;
bool Jumping;
bool FirstJump;

bool Shooting;
bool ChargeShot;

(...)


C_Player::C_Player()
{

MaxSpeedY = 10.5;
X = 0;
Y = 0;

LastSlide = 0;
Sliding = false;
SlidingRight = false;
SlidingLeft = false;
JumpedOnSlide = false;

CanJump = false;
Jumping = false;
FirstJump = true;

Shooting = false;
ChargeShot = false;

Direction = ENTITY_DIRECTION_RIGHT;
Type = ENTITY_TYPE_PLAYER;
Flags = ENTITY_FLAG_GRAVITY;

Dead = false;

}


class C_PlayerShade : public C_Entity {

private:
C_Entity* target;

float SpeedDelay;

public:
C_PlayerShade();
C_PlayerShade(C_Entity* parent, float delay);
(...)


C_PlayerShade::C_PlayerShade()
{
SpeedX = 0;
SpeedY = 0;
SpeedDelay = 0;

AccelY = 0;

X = 0;
Y = 0;

target = NULL;

Dead = false;

Direction = ENTITY_DIRECTION_RIGHT;
Type = ENTITY_TYPE_PLAYER;
Flags = ENTITY_FLAG_GRAVITY;
}

C_PlayerShade::C_PlayerShade(C_Entity* parent, float delay)
{

target = parent;

AccelY = target->AccelY;

X = target->X;
Y = target->Y;

SpeedX = target->SpeedX;
SpeedY = target->SpeedY;
SpeedDelay = delay;

Dead = false;

Direction = ENTITY_DIRECTION_RIGHT;
Type = ENTITY_TYPE_GENERIC;
Flags = ENTITY_FLAG_GRAVITY;

OnLoad();

}


bool C_PlayerShade::OnLoad()
{


C_Frameset CharJumpRight( "JUMPINGRIGHT" );
CharJumpRight.AddFrame(0, 188, 25, 48);
CharJumpRight.AddFrame(25, 187, 23, 51);
CharJumpRight.AddFrame(48, 189, 23, 55);
CharJumpRight.AddFrame(71, 187, 23, 57);
CharJumpRight.AddFrame(94, 190, 27, 53);
CharJumpRight.AddFrame(121, 191, 34, 50);

C_Frameset CharJumpLeft( "JUMPINGLEFT" );
CharJumpLeft.AddFrame(0, 245, 25, 48);
CharJumpLeft.AddFrame(25, 244, 23, 51);
CharJumpLeft.AddFrame(48, 246, 23, 55);
CharJumpLeft.AddFrame(71, 244, 23, 57);
CharJumpLeft.AddFrame(94, 247, 27, 53);
CharJumpLeft.AddFrame(121, 248, 34, 50);

C_Frameset CharFallRight( "FALLINGRIGHT" );
CharFallRight.AddFrame(155, 190, 32, 52);
CharFallRight.AddFrame(187, 189, 29, 54);

C_Frameset CharFallLeft( "FALLINGLEFT" );
CharFallLeft.AddFrame(155, 247, 32, 52);
CharFallLeft.AddFrame(187, 246, 29, 52);

C_Frameset CharSlideRight( "SLIDINGRIGHT" );
CharSlideRight.AddFrame(0, 301, 34, 44);
CharSlideRight.AddFrame(34, 301, 46, 44, 10);
CharSlideRight.AddFrame(80, 301, 53, 44, 20);
CharSlideRight.AddFrame(133, 301, 57, 44, 20);
CharSlideRight.AddFrame(190, 301, 38, 44, 10);
CharSlideRight.AddFrame(228, 301, 30, 44, 10);
CharSlideRight.AddFrame(258, 301, 41, 44, 10);
CharSlideRight.AddFrame(299, 301, 43, 44, 10);

C_Frameset CharSlideLeft( "SLIDINGLEFT" );
CharSlideLeft.AddFrame(0, 345, 34, 44);
CharSlideLeft.AddFrame(34, 345, 46, 44);
CharSlideLeft.AddFrame(80, 345, 53, 44);
CharSlideLeft.AddFrame(133, 345, 57, 44);
CharSlideLeft.AddFrame(190, 345, 38, 44);
CharSlideLeft.AddFrame(228, 345, 30, 44);
CharSlideLeft.AddFrame(258, 345, 41, 44);
CharSlideLeft.AddFrame(299, 345, 43, 44);

C_Frameset Transparent("TRANSPARENT");
Transparent.AddFrame(500,0,0,0);

Anim_Control.AddFrameset(CharJumpRight);
Anim_Control.AddFrameset(CharJumpLeft);
Anim_Control.AddFrameset(CharFallRight);
Anim_Control.AddFrameset(CharFallLeft);
Anim_Control.AddFrameset(CharSlideRight);
Anim_Control.AddFrameset(CharSlideLeft);
Anim_Control.AddFrameset(Transparent);

Anim_Control.SetAnimation("TRANSPARENT",150);

if(C_Entity::OnLoad("./gfx/megaman/shade.png") == false)
{
fprintf(stderr, "Failed to load shade.png: %s\n", SDL_GetError());
return false;
}

X = target->X;
Y = target->Y;

SpeedX = target->SpeedX;
SpeedY = target->SpeedY;

AccelY = target->AccelY;

return true;


}



You should use accessor methods instead of public member variables. That's just asking for trouble. Also I'm concerned about the possibility of null pointers in the OnLoad method. Although a pointer to a deleted object is just as bad or worse :/
I guess the pointer to the player might be dangerous, but it will only ever point to the player, and the shades are destroyed before the player every time. And ye I will start using accessor methods, just hacked this stuff together to see if i could make it work.

And to the other one talking about initializer lists, I might start doing that. Guess it clarifies it some.

Thank you both.


Set it ablaze!
Frigo
Profile Joined August 2009
Hungary1023 Posts
November 16 2012 10:59 GMT
#3912
On November 15 2012 23:55 kaykaykay wrote:
Is there anybody decent with Object oriented programing eclipse java here? :D

How can we help?
http://www.fimfiction.net/user/Treasure_Chest
lungic
Profile Joined January 2012
Sweden123 Posts
Last Edited: 2012-11-16 11:17:10
November 16 2012 11:14 GMT
#3913
Edit: nm. Looked it up instead.

Have a nice day everyone!
flabbert
Profile Joined August 2012
Norway4 Posts
November 16 2012 11:52 GMT
#3914
I have a fairly specific problem in php. I started teaching myself php a short while ago by writing an IRC gatherbot for CSGO gathers, however, i now want to get the serverlog from the CSGO server, and parse it. But i am having issues with both the socket connections needing data for the while loop to continue. There should be a way around this, but i have yet to understand how to do it properly.

It is not death nor darkness we fear, only the unknown it represents
MisterD
Profile Blog Joined June 2010
Germany1338 Posts
November 16 2012 12:22 GMT
#3915
On November 16 2012 20:52 flabbert wrote:
I have a fairly specific problem in php. I started teaching myself php a short while ago by writing an IRC gatherbot for CSGO gathers, however, i now want to get the serverlog from the CSGO server, and parse it. But i am having issues with both the socket connections needing data for the while loop to continue. There should be a way around this, but i have yet to understand how to do it properly.


you should really ask a question if you want an answer
Gold isn't everything in life... you need wood, too!
flabbert
Profile Joined August 2012
Norway4 Posts
November 16 2012 13:01 GMT
#3916
On November 16 2012 21:22 MisterD wrote:
Show nested quote +
On November 16 2012 20:52 flabbert wrote:
I have a fairly specific problem in php. I started teaching myself php a short while ago by writing an IRC gatherbot for CSGO gathers, however, i now want to get the serverlog from the CSGO server, and parse it. But i am having issues with both the socket connections needing data for the while loop to continue. There should be a way around this, but i have yet to understand how to do it properly.


you should really ask a question if you want an answer

dumb of me!

how do i manage 2 sockets in 1 while loop?

example:
+ Show Spoiler +

$socket = ircconnection;
$socket2 = csgoserverconnection;

while (!feof($socket) || !feof($socket2))
{
do stuff
}
It is not death nor darkness we fear, only the unknown it represents
EsX_Raptor
Profile Blog Joined February 2008
United States2802 Posts
November 16 2012 16:36 GMT
#3917
Thank you, Bigpet, I now understand how these things work (I copy-pasted and compiled your code, too). You rock! :D

To Craton, I graduated in 2010 and have been working as a software engineer since... using a different language. That's why I said I'd go hide in shame.
FFGenerations
Profile Blog Joined April 2011
7088 Posts
Last Edited: 2012-11-16 19:23:32
November 16 2012 19:17 GMT
#3918
wtf is happening

i change code in my compiler and run it but nothing has changed in the program
im using bloodsomething with C++

like i change the first sentence to qsoijaoijasoi in the code but when it runs it hasnt changed


+ Show Spoiler +

#include <cstdlib>
#include <iostream>
#include <string>
#include <iomanip>
#include <windows.h>
#include <stdio.h>

using namespace std;

int main(int argc, char *argv[])
{

float glossCost = 4.00;
float emulsionCost = 3.50;
float doorPaintRequirement = 1;
float windowPaintRequirement = 0.5;
float vat = 0.2;
float start = 0;
float goAgain;
float roomLength;
float roomHeight;
float roomWidth;
string customerFirstName;
string customerSurname;
char wallsPainted;
float wallpaperRollCount;
float wallpaperRollCost;
float doorNumber;
float windowNumber;

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);

cout<<endl<<"Welcome to Blake's Estimator."<<endl<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"1 - Begin estimate."<<endl;
cout<<"2 - Display instructions."<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);

char startInput[256];
cin>>startInput;
start = atoi (startInput);

while (start !=1 && start !=2)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Please enter 1 to begin an estimate or 2 to display instructions."<<endl;
cin>>startInput;
start = atoi (startInput);
}

if (start == 2)
{
cout<<endl<<"This program will calculate the estimated cost of decorating a room based on "<<endl<<"the input you provide. Units of length are in centimetres. Quantity of "<<endl<<"wallpaper rolls must be a whole number."<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<endl<<"Enter '1' to continue."<<endl;

cin>>start;
while (start !=1)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Enter '1' to continue."<<endl;
cin>>start;
start = atoi (startInput);
}
}

if (start == 1)
{
do
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
cout<<"Enter customer first name."<<endl;
cin>>customerFirstName;

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
cout<<"Enter customer surname."<<endl;
cin>>customerSurname;

char roomLengthInput[256];
cout<<"Enter room length."<<endl;
cin>>roomLengthInput;
roomLength = atoi (roomLengthInput);

while (roomLength < 45 || roomLength > 1000)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Please enter a numerical room length in cm between 45 and 1000."<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
cin>>roomLengthInput;
roomLength = atoi (roomLengthInput);
}

char roomWidthInput[256];
cout<<"Enter room width."<<endl;
cin>>roomWidthInput;
roomWidth = atoi (roomWidthInput);

while (roomWidth < 45 || roomWidth > 1000)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Please enter a numerical room width in cm between 45 and 1000."<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
cin>>roomWidthInput;
roomWidth = atoi (roomWidthInput);
}

char roomHeightInput[256];
cout<<"Enter room height."<<endl;
cin>>roomHeightInput;
roomHeight = atoi (roomHeightInput);

while (roomHeight < 45 || roomHeight > 1000)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Please enter a numerical room height in cm between 45 and 1000."<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
cin>>roomHeightInput;
roomHeight = atof (roomHeightInput);
}

cout<<"Are walls painted (p) or wallpapered (w)?"<<endl;
cin>>wallsPainted;

while (wallsPainted !='p' && wallsPainted !='w')
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Enter 'p' if walls are painted or 'w' if walls are wallpapered."<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
cin>>wallsPainted;
}

if (wallsPainted == 'w')
{
char wallpaperRollCountInput[256];
cout<<"Enter required number of wallpaper rolls."<<endl;
cin>>wallpaperRollCountInput;
wallpaperRollCount = atoi (wallpaperRollCountInput);

while (wallpaperRollCount < 1 || wallpaperRollCount > 70)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Wallpapers rolls must be greater than 0 and less than 70."<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
cin>>wallpaperRollCountInput;
wallpaperRollCount = atoi (wallpaperRollCountInput);
}

char wallpaperRollCostInput[256];
cout<<"Enter cost of each roll in pounds."<<endl;
cin>>wallpaperRollCostInput;
wallpaperRollCost = atof (wallpaperRollCostInput);

while (wallpaperRollCost < 1 || wallpaperRollCost > 30)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Cost of roll must be greater than 0 and less than 30 pounds."<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
cin>>wallpaperRollCostInput;
wallpaperRollCost = atof (wallpaperRollCostInput);
}
}

char doorNumberInput[256];
cout<<"Enter number of doors."<<endl;
cin>>doorNumberInput;
doorNumber = atof (doorNumberInput);

while (doorNumber < 1 || doorNumber > 10)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Number of doors must be greater than 0 and less than 11."<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
cin>>doorNumberInput;
doorNumber = atof (doorNumberInput);
}

char windowNumberInput[256];
cout<<"Enter number of windows."<<endl;
cin>>windowNumberInput;
windowNumber = atof (windowNumberInput);

while (windowNumber < 1 || windowNumber > 10)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Number of windows must be less than 11."<<endl;
cin>>windowNumberInput;
windowNumber = atof (windowNumberInput);
}

float ceilingLitres = (roomLength/100)*(roomWidth/100)/8;
float ceilingCosts = ceilingLitres*emulsionCost;
float wallsLitres = ((roomLength/100*roomHeight/100)+(roomWidth/100*roomHeight/100)*2)-(doorNumber*2)-(windowNumber*2) /8;
float totalWallsPaintedCost = wallsLitres*emulsionCost;
float totalWallpaperCost = wallpaperRollCount*wallpaperRollCost;
float woodworkLitres = (doorNumber*doorPaintRequirement)+(windowNumber*windowPaintRequirement);
float totalWoodworkCost = woodworkLitres*glossCost;

cout << string(49, '\n');
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
cout<<endl<<"Joe Stevens Painting & Decorating Tel: 01522 522522"<<endl;
cout<<endl<<endl<<"Estimate costs for "<<customerFirstName<<" "<<customerSurname<<"."<<endl<<endl;
cout<<"MATERIALS"<<endl;
cout<<"Ceiling: "<<setiosflags(ios::fixed)<<setprecision(2)<<ceilingLitres<<" @ "<<setiosflags(ios::fixed)<<setprecision(2)<<(char)156<<emulsionCost<<" per litre "<<(char)156<<ceilingCosts<<endl;

switch (wallsPainted)
{
case 'p':
cout<<"Walls: "<<setiosflags(ios::fixed)<<setprecision(2)<<wallsLitres<<" @ "<<setiosflags(ios::fixed)<<setprecision(2)<<(char)156<<emulsionCost<<" per litre "<<(char)156<<totalWallsPaintedCost<<endl;
break;
case 'w':
totalWallsPaintedCost == 0;
cout<<totalWallsPaintedCost<<endl;
cout<<"wtf"<<endl;
cout<<"Walls: "<<setiosflags(ios::fixed)<<setprecision(2)<<wallpaperRollCount<<" @ "<<setiosflags(ios::fixed)<<setprecision(2)<<(char)156<<wallpaperRollCost<<" per roll "<<(char)156<<totalWallpaperCost<<endl;
break;
}

cout<<"Woodwork: "<<setiosflags(ios::fixed)<<setprecision(2)<<woodworkLitres<<" @ "<<setiosflags(ios::fixed)<<setprecision(2)<<(char)156<<glossCost<<" per litre "<<(char)156<<totalWoodworkCost<<endl<<endl;

float subtotal = totalWallsPaintedCost+totalWallpaperCost+totalWoodworkCost+ceilingCosts;
float subtotalVat = subtotal*vat;
float finalTotal=subtotal+subtotalVat;

cout<<" SUB TOTAL "<<setiosflags(ios::fixed)<<setprecision(2)<<(char)156<<subtotal<<endl;
cout<<" VAT @ 20% "<<setiosflags(ios::fixed)<<setprecision(2)<<(char)156<<subtotalVat<<endl;
cout<<" FINAL TOTAL "<<setiosflags(ios::fixed)<<setprecision(2)<<(char)156<<finalTotal<<endl<<endl;

if(ceilingLitres < 0.1 || wallsLitres < 0.1 || woodworkLitres < 0.1)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),12);
cout<<"WARNING: You may have doors or windows that use total paint quantities in "<<endl<<"excess of the total room size.";
}

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);

char goAgainInput[256];
cout << string(4, '\n');
cout<<"What would you like to do now?"<<endl<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"1 - Begin a new estimate."<<endl;
cout<<"2 - Exit the program."<<endl;
cin>>goAgainInput;
goAgain = atoi (goAgainInput);

while (goAgain != 1 && goAgain != 2)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Please enter 1 to begin again or 2 to quit."<<endl;
cin>>goAgainInput;
goAgain = atof (goAgainInput);
}

} while (goAgain == 1);

system("PAUSE");
return EXIT_SUCCESS;
}
}



edit
ok i opened a new compiler application and copy pasted, working again....

User was temp banned for this post.
Cool BW Music Vid - youtube.com/watch?v=W54nlqJ-Nx8 ~~~~~ ᕤ OYSTERS ᕤ CLAMS ᕤ AND ᕤ CUCKOLDS ᕤ ~~~~~~ ༼ ᕤ◕◡◕ ༽ᕤ PUNCH HIM ༼ ᕤ◕◡◕ ༽ᕤ
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
November 16 2012 20:06 GMT
#3919
On November 17 2012 04:17 FFGenerations wrote:
wtf is happening

i change code in my compiler and run it but nothing has changed in the program
im using bloodsomething with C++

like i change the first sentence to qsoijaoijasoi in the code but when it runs it hasnt changed


+ Show Spoiler +

#include <cstdlib>
#include <iostream>
#include <string>
#include <iomanip>
#include <windows.h>
#include <stdio.h>

using namespace std;

int main(int argc, char *argv[]
{

float glossCost = 4.00;
float emulsionCost = 3.50;
float doorPaintRequirement = 1;
float windowPaintRequirement = 0.5;
float vat = 0.2;
float start = 0;
float goAgain;
float roomLength;
float roomHeight;
float roomWidth;
string customerFirstName;
string customerSurname;
char wallsPainted;
float wallpaperRollCount;
float wallpaperRollCost;
float doorNumber;
float windowNumber;

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);

cout<<endl<<"Welcome to Blake's Estimator."<<endl<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"1 - Begin estimate."<<endl;
cout<<"2 - Display instructions."<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);

char startInput[256];
cin>>startInput;
start = atoi (startInput);

while (start !=1 && start !=2)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Please enter 1 to begin an estimate or 2 to display instructions."<<endl;
cin>>startInput;
start = atoi (startInput);
}

if (start == 2)
{
cout<<endl<<"This program will calculate the estimated cost of decorating a room based on "<<endl<<"the input you provide. Units of length are in centimetres. Quantity of "<<endl<<"wallpaper rolls must be a whole number."<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<endl<<"Enter '1' to continue."<<endl;

cin>>start;
while (start !=1)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Enter '1' to continue."<<endl;
cin>>start;
start = atoi (startInput);
}
}

if (start == 1)
{
do
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
cout<<"Enter customer first name."<<endl;
cin>>customerFirstName;

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
cout<<"Enter customer surname."<<endl;
cin>>customerSurname;

char roomLengthInput[256];
cout<<"Enter room length."<<endl;
cin>>roomLengthInput;
roomLength = atoi (roomLengthInput);

while (roomLength < 45 || roomLength > 1000)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Please enter a numerical room length in cm between 45 and 1000."<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
cin>>roomLengthInput;
roomLength = atoi (roomLengthInput);
}

char roomWidthInput[256];
cout<<"Enter room width."<<endl;
cin>>roomWidthInput;
roomWidth = atoi (roomWidthInput);

while (roomWidth < 45 || roomWidth > 1000)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Please enter a numerical room width in cm between 45 and 1000."<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
cin>>roomWidthInput;
roomWidth = atoi (roomWidthInput);
}

char roomHeightInput[256];
cout<<"Enter room height."<<endl;
cin>>roomHeightInput;
roomHeight = atoi (roomHeightInput);

while (roomHeight < 45 || roomHeight > 1000)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Please enter a numerical room height in cm between 45 and 1000."<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
cin>>roomHeightInput;
roomHeight = atof (roomHeightInput);
}

cout<<"Are walls painted (p) or wallpapered (w)?"<<endl;
cin>>wallsPainted;

while (wallsPainted !='p' && wallsPainted !='w')
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Enter 'p' if walls are painted or 'w' if walls are wallpapered."<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
cin>>wallsPainted;
}

if (wallsPainted == 'w')
{
char wallpaperRollCountInput[256];
cout<<"Enter required number of wallpaper rolls."<<endl;
cin>>wallpaperRollCountInput;
wallpaperRollCount = atoi (wallpaperRollCountInput);

while (wallpaperRollCount < 1 || wallpaperRollCount > 70)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Wallpapers rolls must be greater than 0 and less than 70."<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
cin>>wallpaperRollCountInput;
wallpaperRollCount = atoi (wallpaperRollCountInput);
}

char wallpaperRollCostInput[256];
cout<<"Enter cost of each roll in pounds."<<endl;
cin>>wallpaperRollCostInput;
wallpaperRollCost = atof (wallpaperRollCostInput);

while (wallpaperRollCost < 1 || wallpaperRollCost > 30)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Cost of roll must be greater than 0 and less than 30 pounds."<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
cin>>wallpaperRollCostInput;
wallpaperRollCost = atof (wallpaperRollCostInput);
}
}

char doorNumberInput[256];
cout<<"Enter number of doors."<<endl;
cin>>doorNumberInput;
doorNumber = atof (doorNumberInput);

while (doorNumber < 1 || doorNumber > 10)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Number of doors must be greater than 0 and less than 11."<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
cin>>doorNumberInput;
doorNumber = atof (doorNumberInput);
}

char windowNumberInput[256];
cout<<"Enter number of windows."<<endl;
cin>>windowNumberInput;
windowNumber = atof (windowNumberInput);

while (windowNumber < 1 || windowNumber > 10)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Number of windows must be less than 11."<<endl;
cin>>windowNumberInput;
windowNumber = atof (windowNumberInput);
}

float ceilingLitres = (roomLength/100)*(roomWidth/100)/8;
float ceilingCosts = ceilingLitres*emulsionCost;
float wallsLitres = ((roomLength/100*roomHeight/100)+(roomWidth/100*roomHeight/100)*2)-(doorNumber*2)-(windowNumber*2) /8;
float totalWallsPaintedCost = wallsLitres*emulsionCost;
float totalWallpaperCost = wallpaperRollCount*wallpaperRollCost;
float woodworkLitres = (doorNumber*doorPaintRequirement)+(windowNumber*windowPaintRequirement);
float totalWoodworkCost = woodworkLitres*glossCost;

cout << string(49, '\n');
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
cout<<endl<<"Joe Stevens Painting & Decorating Tel: 01522 522522"<<endl;
cout<<endl<<endl<<"Estimate costs for "<<customerFirstName<<" "<<customerSurname<<"."<<endl<<endl;
cout<<"MATERIALS"<<endl;
cout<<"Ceiling: "<<setiosflags(ios::fixed)<<setprecision(2)<<ceilingLitres<<" @ "<<setiosflags(ios::fixed)<<setprecision(2)<<(char)156<<emulsionCost<<" per litre "<<(char)156<<ceilingCosts<<endl;

switch (wallsPainted)
{
case 'p':
cout<<"Walls: "<<setiosflags(ios::fixed)<<setprecision(2)<<wallsLitres<<" @ "<<setiosflags(ios::fixed)<<setprecision(2)<<(char)156<<emulsionCost<<" per litre "<<(char)156<<totalWallsPaintedCost<<endl;
break;
case 'w':
totalWallsPaintedCost == 0;
cout<<totalWallsPaintedCost<<endl;
cout<<"wtf"<<endl;
cout<<"Walls: "<<setiosflags(ios::fixed)<<setprecision(2)<<wallpaperRollCount<<" @ "<<setiosflags(ios::fixed)<<setprecision(2)<<(char)156<<wallpaperRollCost<<" per roll "<<(char)156<<totalWallpaperCost<<endl;
break;
}

cout<<"Woodwork: "<<setiosflags(ios::fixed)<<setprecision(2)<<woodworkLitres<<" @ "<<setiosflags(ios::fixed)<<setprecision(2)<<(char)156<<glossCost<<" per litre "<<(char)156<<totalWoodworkCost<<endl<<endl;

float subtotal = totalWallsPaintedCost+totalWallpaperCost+totalWoodworkCost+ceilingCosts;
float subtotalVat = subtotal*vat;
float finalTotal=subtotal+subtotalVat;

cout<<" SUB TOTAL "<<setiosflags(ios::fixed)<<setprecision(2)<<(char)156<<subtotal<<endl;
cout<<" VAT @ 20% "<<setiosflags(ios::fixed)<<setprecision(2)<<(char)156<<subtotalVat<<endl;
cout<<" FINAL TOTAL "<<setiosflags(ios::fixed)<<setprecision(2)<<(char)156<<finalTotal<<endl<<endl;

if(ceilingLitres < 0.1 || wallsLitres < 0.1 || woodworkLitres < 0.1)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),12);
cout<<"WARNING: You may have doors or windows that use total paint quantities in "<<endl<<"excess of the total room size.";
}

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);

char goAgainInput[256];
cout << string(4, '\n');
cout<<"What would you like to do now?"<<endl<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"1 - Begin a new estimate."<<endl;
cout<<"2 - Exit the program."<<endl;
cin>>goAgainInput;
goAgain = atoi (goAgainInput);

while (goAgain != 1 && goAgain != 2)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),233);
cout<<"Please enter 1 to begin again or 2 to quit."<<endl;
cin>>goAgainInput;
goAgain = atof (goAgainInput);
}

} while (goAgain == 1);

system("PAUSE");
return EXIT_SUCCESS;
}
}



edit
ok i opened a new compiler application and copy pasted, working again....


Some IDEs only recompile new parts for performance reasons unless you explicitely say "Rebuild All". Check for such a menu option. Alternatively, some IDEs also have a "clean all", which removes all previously compiled executeables.
FFGenerations
Profile Blog Joined April 2011
7088 Posts
November 16 2012 23:55 GMT
#3920
thanks, there is a rebuild all option iirc
got my first coding assignment in anyway
yay
Cool BW Music Vid - youtube.com/watch?v=W54nlqJ-Nx8 ~~~~~ ᕤ OYSTERS ᕤ CLAMS ᕤ AND ᕤ CUCKOLDS ᕤ ~~~~~~ ༼ ᕤ◕◡◕ ༽ᕤ PUNCH HIM ༼ ᕤ◕◡◕ ༽ᕤ
Prev 1 194 195 196 197 198 1032 Next
Please log in or register to reply.
Live Events Refresh
GSL
08:00
2026 GSTL: Grand Finals
RotterdaM685
CranKy Ducklings SOOP99
SHIN 98
Rex40
GSL EN (SOOP)0
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 685
LamboSC2 160
SHIN 98
mouzStarbuck 74
MindelVK 54
Rex 40
StarCraft: Brood War
Britney 55921
Shuttle 1895
EffOrt 657
Mini 588
Last 572
Light 383
Rush 336
BeSt 318
firebathero 274
ZerO 251
[ Show more ]
Stork 230
Snow 180
Mong 171
Barracks 140
Hyun 89
Yoon 75
Sea.KH 52
ToSsGirL 47
NaDa 30
Bale 25
sorry 23
Sharp 20
zelot 18
HiyA 18
Sexy 12
ajuk12(nOOB) 11
Free 10
Noble 6
JulyZerg 6
Terrorterran 3
Dota 2
Gorgc6162
qojqva1123
Dendi860
Counter-Strike
Fnx 801
x6flipin783
kRYSTAL_62
edward39
Super Smash Bros
Mew2King36
Heroes of the Storm
Trikslyr54
Khaldor18
Other Games
B2W.Neo829
DeMusliM273
Livibee175
Happy158
ArmadaUGS122
ZerO(Twitch)16
QueenE13
Organizations
Dota 2
PGL Dota 2 - Main Stream14027
Other Games
BasetradeTV258
StarCraft: Brood War
lovetv 6
[ Show 10 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 4016
Other Games
• WagamamaTV216
Upcoming Events
Yamato Cup
2h 5m
BSL Open Qualifier
6h 5m
BSL Open Qualifier
6h 5m
OSC
10h 5m
Replay Cast
11h 5m
Afreeca Starleague
21h 5m
Soma vs Jaedong
WardiTV Weekly
22h 5m
Monday Night Weeklies
1d 3h
Sparkling Tuna Cup
1d 21h
Afreeca Starleague
1d 21h
Leta vs Soulkey
[ Show More ]
PiGosaur Cup
2 days
Kung Fu Cup
2 days
The PondCast
3 days
Replay Cast
4 days
CranKy Ducklings
5 days
Online Event
5 days
FEL
6 days
BSL: Ladder Tournament
6 days
Sparkling Tuna Cup
6 days
Liquipedia Results

Completed

Acropolis #5 - GSA
Blizzard Classic Cup 2026
Calamity Invitational

Ongoing

ASL Season 22
Super Anchor Qualifying S3
CSL 2026 AUTUMN (S22)
Acropolis #5
1win Private Club #1
Logitech G Play Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #3
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3

Upcoming

Acropolis #5 - GSB
Acropolis #5 - GSC
BSL Season 23
SC4ALL II: Brood War
BSL 23: Non-Korean Championship
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
Custodian Cup
Copium Cup
PGL Major Singapore 2026
Stake Ranked Episode 6
BLAST Rivals Fall 2026
IEM Beijing 2026
Stake Ranked Episode 5
PGL Masters Bucharest 2026
1win Private Club #2
Thunderpick World Champ. '26
ESL Pro League Season 24
Stake Ranked Episode 4
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.