Question: I try to create a program that can evaluate simple math expression like "4+4". The expression is given from the user. 

The program saves it in a `char*` and then searches for binary operation (+,-,\*,:) and does the operation. 

The problem is that I can't figure out how to convert the **single** `char` into a `double` value. 

I know there is the `atof` function but I want to convert single `char`.

There is a way to do that without creating a `char*`?

Answer: 
first create input element of type file and execute function click() to open dialog file selector, follow step is upload selected image (in my case I use [ng-file-upload](https://github.com/danialfarid/ng-file-upload)) and retrieve the public url, remember use promises for wait user action, last step is set url in field of tinymce this is posible with field\_name document.getElementById(field\_name).value

```
$scope.tinymceOptions = {
    selector: "textarea",
    plugins: 'image',
    file_browser_callback: function (field_name, url, type, win) {               
        let input = document.createElement('input');
        input.setAttribute('type', 'file');
        input.setAttribute('accept', 'image/*');            
        input.click();
        input.addEventListener('change', (event) => {
            let defered = $q.defer();
            Upload.upload({
                url: MultimediaService.uploadDocument(),
                data: {
                    file: event.path[0].files[0]
                }
            }).then(function (resp) {
                defered.resolve(resp);                        
            }, function (err) {
                defered.reject(err);
            });
            defered.promise.then(function (resp) {
                document.getElementById(field_name).value = resp['data']['url'];
                return resp['data']['url'];
            }, function (err) {
                return null;
            });
        });
    },
    paste_as_text: true
};

```
This has worked for me, used @tinymce/angular - angular version 11

In component.html file

```
<editor [id]="'editorID1'" style="margin-left: 0em" [formControlName]="'questiontext'" placeholder="Date"
       class="form-control" apiKey=" place your api key here" [init]="editorConfig">
</editor>

```

It's in ts file:

```
  let editorConfig = {
  paste_data_images: true,

  file_picker_callback: function(callback:any, value:any, meta:any) {
    var input = document.createElement('input');
    input.setAttribute('type', 'file');
    input.setAttribute('accept', 'image/*');
      if (meta.filetype == 'image') {
         input.click();
         // jQuery('#test-upload').trigger('click');
         //   input.on('change', function(e:any) {               
          input.onchange = function (e:any) {
          //jQuery('#test-upload').on('change', function(e:any) {
              var file:any = e.target.files[0];
              var reader = new FileReader();
              reader.onload = function(e: any) {
                  callback(e.target.result, {
                      alt: ''
                  });
              };
              reader.readAsDataURL(file);
          };
      }
  },

...
}

```