Taking input using delimiter in C++ [closed] - c++

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
After taking those values I have to store the values in two different arrays (say x and y)

So the only error I can immediately see is this
float* a = NULL;
a = new(nothrow)float;
which should be
float* a = new float[count];
Your version only allocates enough space for a single float when you really need space for count floats.
When you have code that isn't working, and you want to ask a question about it you really should say exactly what happens when you run the code. Doing this will help get you better answers.

Related

Filling a dynamic array with integers c++ [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 27 days ago.
Improve this question
how to fill a dynamic array with input from the console? Im begginer
and can't understand it.
some help will make my day :|
You can realize this in several ways. Have a look on following post may it will help you..
Using scanf() in C++ programs is faster than using cin?

how to add number to the end of the string in c++? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I did various implementations but they take a long time
Can anyone give us the best implementation?
For example, add a ten-digit number to the end of a string
I did not find a good answer on the Internet
#include <iostream>
std::string a="string";
long n=1703705707;
a.append(std::to_string(n)); //becomes "string1703705707"

Turning a string that contains a equation into an integer [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I would like to be able to convert a string such as "(5+6)*6" and get the resulting integer from that equation. It is important that it starts out as a string.
You can use library fastmathparser for c++.
In link is example how use this library.
If you really want write alone this parser, I recomended use Shunting-yard algorithm

How to get variables to my program vrom text file [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a file like:
a [able%5:00:00:capable:00] [able] capable
a [abnormal%3:00:00::] [abnormal]
a [absent%3:00:00::] [absent]
a [absolute%3:00:00::] [absolute] perfect or complete
a [abstract%3:00:00::] [abstract] existing only in the mind
a [abundant%3:00:00::] [abundant] plentiful
I want to get first column "avle", "abnormal" etc to my object. How to crop them and how storage them?
Use the string tokenizer, the best/easiest way to split a line into different variables.
char* word = strtok(line," [%:]");
char* word2 = strtok(0," [%:]");
int value = strtoi(strtok(0," [%:]"));
to store there is a vector container, but there can be used any type of arrays, what is more convenient

How to make a MATLAB function to be run in html? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I've developed a MATLAB code that I think it is useful to be used by researchers. How can I embed it in a website to be used free?
It gets two integers and return a set of integers
Also it is possible to convert it to c++, If it helps.
Thanks
Submit your m-file(s) to Matlab Central File Exchange, this is the perfect place for it.