C++ nightmare

This is a catch all off topic forum to talk about anything not covered by other sections.
Locked
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

C++ nightmare

Post by Red Squirrel »

This is why it's best to stick to one language at a time. :roflmao2:

"why won't this dang thing compile!" :lol:

Image


Archived topic from Iceteks, old topic ID:3167, old post ID:25872
Honk if you love Jesus, text if you want to meet Him!
Cold Drink
Posts: 96
Joined: Fri Jul 16, 2004 1:04 pm

C++ nightmare

Post by Cold Drink »

So you too are tainted :) Try and purge all that VB from your mind :)

Archived topic from Iceteks, old topic ID:3167, old post ID:25873
User avatar
Death
Posts: 7919
Joined: Thu Sep 30, 2004 10:12 pm

C++ nightmare

Post by Death »

O M G. Imagine trying to debug that? I can just see it now:

42 ERRORS

WHERE?!!!! LOL

Archived topic from Iceteks, old topic ID:3167, old post ID:25875
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

C++ nightmare

Post by Red Squirrel »

Actually I'm trying to debug it now but a different issue, it compiles but is ingoring some characters when reading a file.

Been trying to debug it for at least an hour... must go to bed... must debug... ahhhhhhhhhhhhh.

Once this program is complete I'll be able to keep a real time status of sympatico's downtime. <_>

Archived topic from Iceteks, old topic ID:3167, old post ID:25876
Honk if you love Jesus, text if you want to meet Him!
wtd
Posts: 157
Joined: Sat Sep 25, 2004 7:21 pm

C++ nightmare

Post by wtd »

And you're using char arrays with C++. That's just asking for buffer overflows. :)

Archived topic from Iceteks, old topic ID:3167, old post ID:25921
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

C++ nightmare

Post by Red Squirrel »

It's the only way though in this case, since I have to read from files and store it in chars. As long as a host in the file does not get bigger than 10000 bytes I should be fine.

Archived topic from Iceteks, old topic ID:3167, old post ID:25922
Honk if you love Jesus, text if you want to meet Him!
wtd
Posts: 157
Joined: Sat Sep 25, 2004 7:21 pm

C++ nightmare

Post by wtd »

Why not just read into a std::string?

Archived topic from Iceteks, old topic ID:3167, old post ID:25997
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

C++ nightmare

Post by Red Squirrel »

I would but most functions I'm used to need chars. Like nearly all string handling functions. or sockets for example, when you specify the host, it needs a char. Though I wish C++ was like php, where you can pass anything and it works, no data types, and no limits. I can store the whole US, Canada and Europe constititions in a single variable if I wanted to. :lol: (that's assuming the server has the memory/swap space)

Archived topic from Iceteks, old topic ID:3167, old post ID:26039
Honk if you love Jesus, text if you want to meet Him!
wtd
Posts: 157
Joined: Sat Sep 25, 2004 7:21 pm

C++ nightmare

Post by wtd »

Red Squirrel wrote: I would but most functions I'm used to need chars. Like nearly all string handling functions. or sockets for example, when you specify the host, it needs a char. Though I wish C++ was like php, where you can pass anything and it works, no data types, and no limits. I can store the whole US, Canada and Europe constititions in a single variable if I wanted to. :lol: (that's assuming the server has the memory/swap space)
Get used to other functions, and when you need char-array strings, just use the c_str member function of the std::string class.

Archived topic from Iceteks, old topic ID:3167, old post ID:26046
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

C++ nightmare

Post by Red Squirrel »

I'll have to look into that, anything to avoid buffer overflows is good. Not sure where to start though, got any tutorials that would help? Since this is basically like learning a new language as all the functions are different.

Archived topic from Iceteks, old topic ID:3167, old post ID:26047
Honk if you love Jesus, text if you want to meet Him!
Locked