Category : c++98

I have a C++ project with const string constants in two .o files, where the constant in one file is initialized using the value in the other file. This used to work fine, but now that I’m using a more recent compiler, I’m getting a seg fault as soon as I launch the program, which ..

Read more

hi guys this is a uni project and at the moment have encountered this issue which comes up during compilation /usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: LinkedListDemo.o:LinkedListDemo.cpp:(.text+0x178): undefined reference to std::operator<<(std::ostream&, std::LinkedList const&)’ LinkedListDemo.o:LinkedListDemo.cpp:(.text+0x178): relocation truncated to fit: R_X86_64_PC32 against undefined symbol std::operator<<(std::ostream&, std::LinkedList const&)’ collect2: error: ld returned 1 exit status make: *** [makefile:11: a1] Error 1 #include <iostream> ..

Read more

int setString(char *pcString) { if( NULL == pcString ) { pcString = ""; } if( NULL == m_pcData ) { m_pcData = new char[m_nBufferLength]; memset(m_pcData, ‘{$content}’, m_nBufferLength); } int nCurrentBuffer = 0; int nLength = 0; int nInputStringLength = 0; nLength = strlen(m_pcData) + knNULL_CHARACTER_SPACE; nCurrentBuffer = (m_nBufferLength > nLength) ? m_nBufferLength : nLength ; ..

Read more

How to implement a JSON based RESTFUL API Server in C++98 There are many solutions available to implement RESTFUL APIs in modern C++ versions. eg : https://github.com/Stiffstream/restinio https://github.com/Microsoft/cpprestsdk https://github.com/loentar/ngrest But I want to implement a JSON based RESTFUL C++ server using the old C++98 version which will serve all GET,PUT,POST and DELETE etc request types ..

Read more