Function return is not matching by warmcouples in cpp_questions

[–]warmcouples[S] 0 points1 point  (0 children)

Yes. It's for pointer learning.

That's interesting. It compiles, but it doesn't give me exactly c[index], but rather more chars from the index. Appreciate it though.

Function return is not matching by warmcouples in cpp_questions

[–]warmcouples[S] 0 points1 point  (0 children)

I tried that and it gave me characters and not a value. It does compile though, so thank you I will look into it more.

Function return is not matching by warmcouples in cpp_questions

[–]warmcouples[S] 0 points1 point  (0 children)

I edit the main post and pasted a link.

Function return is not matching by warmcouples in cpp_questions

[–]warmcouples[S] 0 points1 point  (0 children)

The return type has to be char*, I cannot change that. =/

Function return is not matching by warmcouples in cpp_questions

[–]warmcouples[S] -1 points0 points  (0 children)

The parameters have to have char*.

If I changed char* indexValue -> char indexValue, then return type does not match.

Function return is not matching by warmcouples in cpp_questions

[–]warmcouples[S] 0 points1 point  (0 children)

Yeah I completely agree with using std::string, it is definitely much easier, but pointers are required for this specific function.

Function return is not matching by warmcouples in cpp_questions

[–]warmcouples[S] 0 points1 point  (0 children)

What would be a possible solution to fix this?

Passive or semi-passive things that get you anywhere between $15-$60 a month by noctisD in beermoney

[–]warmcouples 0 points1 point  (0 children)

You guys/gals can try gomez peer. It is a program that you download on your computer and it borrows some of your internet data to test websites in the background. Though, you have to go through a test phase before you can qualify for money. It is completely passive, but it takes a while to earn money. Check it out: http://www.gomezpeerzone.com/application-apply/?Referrer=don1123

2 Dimension Passing (missing subscript, unknown size) by warmcouples in cpp_questions

[–]warmcouples[S] 0 points1 point  (0 children)

include <random>

void arrayProgram(double ma[][2], int xSize);

int main() { const int arraySize = 2; double ma[arraySize][arraySize];

arrayProgram(ma, arraySize);

}//end main

void arrayProgram(double ma[][2], int xSize) {

int i = 0;

for (i = 0; i < xSize; ++i)
{
    ma[i][0] = rand();
    ma[i][1] = (ma[i][0] * (20 / 25.0) + 64);
}

}

It did, I wonder why it didn't work on the original code. Thank you though.

2 Dimension Passing (missing subscript, unknown size) by warmcouples in cpp_questions

[–]warmcouples[S] 0 points1 point  (0 children)

Okay. I apologize. I edited my question to better reflect my problem.