How to create string of strings in c++

A string of strings is different than a table or matrix of strings. String of Strings Let a string be one or more sequential characters, such as “first”. A string may contain another string or commonly known as a substring. The string “theater” contains at least the strings “the”, “eat”, and “ate”. Matrix of Strings … Read more

Call protected function in main class [closed]

No you can’t. The protected accessor on a method means that only the following can access it: the class itself class that inherits from it another class with friendship https://en.cppreference.com/w/cpp/language/access#Protected_member_access

Declaring variable within a function [closed]

int function(int a, int b){ // two variables, a and b, are declared and set equal to whatever you passed in when you called the function. a = a*b; // now you are using the two already-declared variables return(a); // return the value of ‘a’ which was declared in the first line and then modified … Read more

Char* combining [closed]

You can’t use the !Val condition: const char* Val = va_arg(ArgList, const char*); if (!Val) break; When using variable argument list you need to know exactly how many arguments have been passed, or (update) when to stop processing the arguments, using e.g. NULL / nullptr (or any other) sentinel.

My program is crahing, and honestly i am confused (c++)

Not likely to be your crash, but this code is terrible: if (fnameFile.is_open()) { while (fnameFile.eof() == false) { plFname.resize(numFnames); getline(fnameFile,line); numFnames += 1; } fnameFile.close(); } It doesn’t check for end of file correctly, because end of file happens during getline, not before. And the line variable goes nowhere. Try while (getline(fnameFile,line)) plFnames.push_back(line); fnameFile.close();