Off Topic > Off Topic
Programming Megathread
blueblur121:
I format ifs like this
--- Code: ---if() {
//Stuff
}
--- End code ---
And I loving hate this format
--- Code: ---if()
{
//Stuff
}
--- End code ---
Ravencroft·:
Im taking a C++ elective at my college because it's required for my degree and this is my last semester. It just took me 40 minutes to make a 7 line program that averages three test scores, I hate this lol.
Nymph:
--- Quote from: Drydess on February 10, 2016, 12:54:05 AM --- braces*****
--- End quote ---
Curly brackets*****
Ono-Sendai:
--- Quote from: TheBlackParrot on February 10, 2016, 06:17:27 AM ---"i should probably test the API i've been writing"
https://github.com/TheBlackParrot/strimmer-nwjs
http://i.imgur.com/EpkQAdI.png
i'm probably not even using nwjs to its full extent but w/e
--- End quote ---
why do you use nwjs over electron? I've always used the latter and am curious.
Pecon:
--- Quote from: Ravencroft· on February 10, 2016, 12:31:29 PM ---Im taking a C++ elective at my college because it's required for my degree and this is my last semester. It just took me 40 minutes to make a 7 line program that averages three test scores, I hate this lol.
--- End quote ---
Converting types in C++ is a lot of fun when you're using a framework.
--- Code: ---if (fileExists(filepath))
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString("Reading file."));
std::fstream file;
file.open(filepath, std::fstream::in);
char check;
std::string buffer;
FString convertString;
int32 value;
int32 key = 0;
while (file.good())
{
check = file.get();
if (check == '\n')
{
convertString = buffer.c_str();
value = FCString::Atoi(*convertString);
AdjacencyCache.Add(key, value);
buffer = "";
continue;
}
else if (check == '.')
{
key++;
continue;
}
else if (check == '\r')
continue;
else
buffer = buffer + check;
}
}
--- End code ---
(Shown: Reading a file and converting between char* -> std::string -> FString just to read data from a file into an array.)