Is it possible to create a series like this

char j;
int ,k;
for(int i=0;i<10;i++){

I get an error but want to create something like
and so on...

How do i do that ?

9 Years
Discussion Span
Last Post by onaclov2000

first off...you're trying to store ji as a integer, and it's not an integer, you would most likely want to store it as a string or char array.
so what you would want to do is write it as string k, then say

k = "j" + i;

I believe that would be the "syntax" the + might or might not be right, I don't have a compiler in front of me.

Also in that case you don't need j as a char, you can just use the character j for real....if that makes sense....

so finally the code should look like this I think

string k;
for(int i=0;i<10;i++){
k="j" + i;

you might want to add a new line, or something like that to the end so you get a "string" that has all the items on a new line each.

Another option is to write a string array and store the j# in each item in the array.

Good luck,
Let us know how it turns out.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.