How do I do this?
It's the last project I'm working on for a class, it's C++.
I only know how to edit config files for my desktop desu
I only know how to helloworld.exe
>>51743158
your going to have to use a dynamic string array to be resized every time it reads a new string (make a function out of it)
make a variable to count the total number of strings
then use that variable to make your loops for each question
>>51743158
do you have an example of the LIST.txt file?
>>51743363
https://gist.github.com/anonymous/3d1eb71d2f3ebd6d4bf8
are you literally to stupid to stupid to perform basic tasks?
create a 2d array thats 'big enough';
'open' the file.
read the file into a buffer until you get a newline character.
put the string in the array.
iterate over array and its strings (they are just char arrays)
simply compare chars
and do what you want next.
God you are hopeless.
I hope you fail hard.
I don't know C++ but if it's anything like C
Malloc/realloc for array of array of chars. Qsort for sorting. Strstr for spaces or A
>>51743700
>you're retarded because you're in an intro class for programming
oh man, i didn't realize.
>>51743232
me to xD i3 4 lyf
Use libraries and tell them to fuck off.
>>51743766
to be fair if they haven't taught you this shit, the school is retarded, if they have and you can't work it out, you're retarded
>>51743158
Since they didn't ask you to ``print EACH of the following'', i would take the concepts/strings from LIST.txt and store them into ``and'' array of strings and print the following:
All the concepts from the array in alphabetical order that contain spaces, the letter A ( small of large caps ) and that start with a consonant.
>>51743854
it's an online class, they aren't teaching me anything. i'm actually paying to read my own book.
>>51743872
No, you're paying to get credits.
>>51743892
regardless i am still teaching myself.
>>51743948
You're always teaching yourself, silly nigger.
Google can solve most of this, what you are probably missing is what you should google.
Figure out how to read a text file into a dynamic string array.
Figure out how to order a string array in alphabetical order.
Figure out how to see if a string contains a whitespace.
Figure out how to see if a string contains a letter (hint, it's similar to whitespace, don't forget to check for upper and lower case).
Last one your might be able to do with some library function I don't know about, but it is also similar to the above two. A string starts with a consonant if it is in the character index value of a-z and it is not a vowel.
Bit of advice for the future, if you are planning to program for a living, you have a lot of work to do. This is very trivial stuff that most people here were doing in middle school. Maybe you already know that though.
>>51743965
>>51743158
http://www.cplusplus.com/reference/algorithm/sort/
http://www.cplusplus.com/reference/string/string/
You're welcome. C++ libraries are really nice, at least compared to doing it the hard way in C. You don't even have to use the string functions if you want to just write functions that checks a string for spaces, letters etc.
>>51743970
I'm not, don't worry lol. I'm a conceptual designer, I never wanted to touch this stuff but they are forcing me to take it "for muh program".
>>51744012
>>51743970
>>51743346
ty anons
>>51743700
>>51743707
C++ has iostreams. You don't even have to worry about buffer allocation.#include <sstream>
#include <iostream>
#include <string>
#include <fstream>
....
std::ifstream fs(file.c_str());
std::string line;
if (!fs.good())
{
printf("panic");
}
while (std::getline(fs, line))
{
// Process line
}
You may not even need all those includes. I'm doing other stuff in the program I pulled that from.
>>51744103
iostream is the only one we've been using so far.
>>51744158
and this is your final project?
What the fuck, family.
>>51744175
Seems doable. My final project for my first coding class was to program boggle with recursive search and we only knew scanner
>>51744198
>Seems doable.
No shit, it's like 2nd week shit.
I'm pretty sure anon just didn't pay any attention in class.
>>51744226
He said it was online. But yeah, it seems easy enough.
>>51744175
we only had 5, it was a fast track course
>>51744226
see
>>51743995
>>51743965
I agree with you entirely except on the terminology. What he's doing is called learning. He can't teach himself something he doesn't know, to be succint. He can learn something new, though.
Wow this is just
>how to read strings
>how to array/struct/if/for
>how to regular expression
>no algorithmic restriction
>no hardware restriction
>no OO or custom types
>easy mode
>>51744892
ez for you
this is what i have so far, i just started writing it out pls help
https://gist.github.com/anonymous/844dd113fcceefb53251
>>51745004
ew what was i doing
https://gist.github.com/anonymous/ddc44f27fdd930e619e0