char domen[100];
char stroka = "В чащах юга жил бы цитрус";
strcpy(domen, stroka);
long double a = 1.4142135623730950488; double b = 1.4142135623730950488;
почему переменная типа long double хранит данные с такой же точностью, как и переменная типа double?
long double a = 1.4142135623730950488L;
The type of a floating literal is double unless explicitly specified by a suffix.
уже 2 день с этой задачей борюсь
как это реализовать(теоретически)?
#include<iostream>
#include<sstream>
#include<string>
#include<fstream>
using namespace std;
string process(const string& filename)
{
ostringstream os;
if(ifstream ifs(filename); ifs)
{
string line;
while(getline(ifs, line))
{
if(auto pos = line.find("link"); pos != string::npos)
{
pos = line.find('\"', pos);
auto end = line.find('\"', pos + 1);
os << process(line.substr(pos + 1, end - pos - 1));
continue;
}
os << line << "\n";
}
}
return os.str();
}
int main()
{
cout << process("text.txt");
cin.get();
}
char str1[5]; char str2[3]; fgets(str1,5,stdin); fgets(str2,3,stdin);
Я ожидаю, что при запуске введу слово из 5 букв, потом слово из 3
fgets() reads in at most one less than size characters from stream
and stores them into the buffer pointed to by s.
Reading stops after an EOF or a newline.
If a newline is read, it is stored into the buffer.