• 0
Votes
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 195

Backtrace:

File: /home/u125378470/domains/lawhelpguru.org/public_html/application/views/question.php
Line: 195
Function: _error_handler

File: /home/u125378470/domains/lawhelpguru.org/public_html/application/controllers/Questions.php
Line: 416
Function: view

File: /home/u125378470/domains/lawhelpguru.org/public_html/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

EM_JS : unable to free const char* in cpp

    EM_JS(const char*, get_todo_item, (const char *str), {
        return Asyncify.handleAsync(async() => {
            const text = UTF8ToString(str);
            out("text >> " + text);
            let response = await fetch("https://jsonplaceholder.typicode.com/todos/1");
            response = await response.json();
            var lengthBytes = lengthBytesUTF8(jstring)+1;
            var stringOnWasmHeap = _malloc(lengthBytes);
            stringToUTF8(jstring, stringOnWasmHeap, lengthBytes);
            return stringOnWasmHeap;
        });
    });

int main()
    {       
        const char*  response = get_todo_item("4455454545");
        std::free( response);
        return 0;
    }

Got compilation error : cannot initialize a parameter of type 'void *' with an lvalue of type 'const char *' std::free( response); Also tried: std::free((char *)response) successful compilation but memory is not freed when checking with cout. Followed documentaion from : https://emscripten.org/docs/api_reference/emscripten.h.html#c.EM_JS