The program i'm posting is based on that trendy Mad Libs type of story that sells hot-fire to kids and adults. (Yes, they had 50 shades of grey for fucking adults)
>Overlooks the fact i'm learning C++, not yet have developed all the functionalities, i' m still learning.
I know that's used to simulate string with arrays in C, but i'm still learning.
Why did I create this goddamn thread? I know it would end up derailling.
This serves me as experience.
Dominic Wright
desu you repeat yourself a lot in the code. many of the phrases are repeated. you could try using something like a text string with the contents and replacing the values on the string with the input, also try loading the story from a txt file.
your indentation is kinda messy too.
Robert Moore
You should be grateful for criticism. If you can't stand being told that your work is shit, you shouldn't be programming, and you shouldn't be posting on Sup Forums for that matter. Eventually you will reach the zen moment where you realize that everything is shit, and you will not be so bothered by these sorts of comments.
Gavin Hill
I appreciate critcism, but no one posted any programs, and that was the point of creating this thread.
Er, mind posting source file or screenshot to enlighten me?
do you really need to use cout for every single sentence? java does not have this problem.
Alexander Clark
You don't, but otherwise it will end up being messy.
You can add a "\" at the end instead of the " to extend towards the next line, I only used it in this case so the story can be read neatly in the command window.
What's your problem? I downloaded the batch file, but it did nothing visibly helpful, infact when I tried to close it, it would freeze. Not to mention windows entered some sort of compatability black version on the desktop.
Maybe it did have other function, but the batch ran horribly on my PC for unknown reasons but I doubt it.
Isaiah Morris
all the code inside your if blocks should be a level of indentation higher. select it and press tab
eg. if (cond) { code; }
about the strings, i mean like, write a few text files like this
"Hi, I'm |NAME| and I'm |AGE| years old"
load its contents with c++ (IIRC it's on std::iostream) and replace |NAME| with the name, |AGE| with the age, etc
i wouldn't be surprised if c++ doesn't have a string replacement function though. if it doesn't, disregard this.
also, . you don't need to cout everywhere. you know, if you do it like this: cout
Brody Peterson
cout
Charles Miller
>I downloaded the batch file, but it did nothing visibly helpful, infact when I tried to close it, it would freeze. Wow. You are either very young or RPing pretty convincingly. I'll explain.
FYI, what I posted was a famous fork bomb for Windows. stackoverflow.com/questions/13436408/what-is-00-and-how-does-it-work. I never thought you'd run it. I still doubt you have, but just in case, take it as a very low-cost lesson in how you should not run code from Sup Forums unless you fully understand it. It could have been ransomware.
Austin Wood
I can see now that the indent is used to make the blocks of code look cleaner, and how you taught cout doesn't have to be used multiple times, thanks Mr.Animu user!
However, you lost me at strings, don't you have to declare the char with the char arrays first? Don't I need to put header too?
Lincoln Davis
dude just read a programming book. c++ is for cucks use java instead unless ur making gaymes
Noah Wilson
I heard about term double attack, and buffer-overflows, but I never thought it could be used in an .exe.
I thought it would usually be done against servers through hacking or insecure programming.
Adrian Russell
>I never thought it could be used in an .exe. You should seriously read some sysadmin-type book about how Windows works.
Julian Wood
>Gaymes
I'm only learning it to use Unreal Engine later on, you caught me.
Gavin Carter
Do I really?
If anything I learned today in Sup Forums, it is to never post .exe files and only post sources, vice-versa.
I'm not gonna dedicate to learn all that jargon.
Ryder Lee
>Before I leave this thread to learn some C++ Yes.
Nolan Rogers
first, stop using char arrays. read up on std::string.
the idea is, have a few text files in the same folder as the program/code, name them something meaningful. as this program seems to differ its output based solely on the gender variable, it would be wise to name the files the possible values for gender.
some pseudocode for what i mean is: string fileContents = read(gender + ".txt"); fileContents.replaceAll("|IDOL|", idol); // here idol is the variable the user inputted, and |IDOL| is what will be replaced // repeat this for all user input variables cout
Jack Sanders
It doesn't have have the "replaceAll" method. Writing up every variable with [ ] if it did work sounds much more complicated.
Thanks for the previous help, but this seems too convoluted for what's needed to finish the job.