Off Topic > Off Topic

Programming Megathread

Pages: << < (164/241) > >>

Glass Joe:


--- Quote from: ZSNO on August 12, 2016, 12:47:59 AM ----snip-

--- End quote ---
Thanks! Using this, I was able to use the enum without any issues, and everything compiles without errors, but now I have a new problem:

Breakpoint 1, App::OnInit (this=0x6afe28) at source/maininit.cpp:71
71              files.push_back("media/img/ring/ring1.png");
(gdb) print files[static_cast<int>(SPRITE_RING1)] (this is called later on when getting the filename)
$5 = (__gnu_cxx::__alloc_traits<std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::value_type &) @0x21e3938: <error reading variable>

It looks like the std::string's constructor won't accept the string for whatever reason.

Otis Da HousKat:


--- Quote from: Foxscotch on August 12, 2016, 12:00:44 AM ---I love seeing people using node
because I love node

--- End quote ---
too bad node blows ass and is only popular because of Indians and stuffty webdevs.

ZSNO:


--- Quote from: Glass Joe on August 12, 2016, 01:08:14 PM ---Thanks! Using this, I was able to use the enum without any issues, and everything compiles without errors, but now I have a new problem:

Breakpoint 1, App::OnInit (this=0x6afe28) at source/maininit.cpp:71
71              files.push_back("media/img/ring/ring1.png");
(gdb) print files[static_cast<int>(SPRITE_RING1)] (this is called later on when getting the filename)
$5 = (__gnu_cxx::__alloc_traits<std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::value_type &) @0x21e3938: <error reading variable>

It looks like the std::string's constructor won't accept the string for whatever reason.

--- End quote ---
Not sure why you're getting that error.
This test code runs fine.

--- Code: ---#include <iostream>
#include <string>
#include <vector>

int main()
{
std::vector<std::string> files;
files.push_back("Meow butt");
std::cout << files[0] << std::endl;
return 0;
}
--- End code ---


carolcat:

i got put into an online programming class. no idea what language. how much of a nightmare is this going to be

Becquerel:


--- Quote from: carolcat on August 12, 2016, 07:22:42 PM ---i got put into an online programming class. no idea what language. how much of a nightmare is this going to be

--- End quote ---
If youre going with web design, go with HTML, CSS, Javascript, and a few others like PHP
If your going for more practical things, theres Python, C (and its variants C++ and C#),  and some others
Theres also what are called "Esoteric Programming Languages". These arent really meant to be taken serious, theyre more of an novelty language for programmer enjoyment. Theres one EPL called "Brainforget" which is supposedly really hard to work with.
If you ever need help, the fourm has alot of computer gurus like ZSNO and Pecon
One more thing, if you get put into a AP Computer Science course, most of them as far as I know use Java

Pages: << < (164/241) > >>

Go to full version