rand fun in c++

hellow there
i want to know if i can do rand function for char pointer?
i want to do a fun that get some string and his capacity and return a randomal char for it??
i get a test this weekend so i'll appreciate any help!!!
thanks allot!!
Do you mean a random letter?
1
2
3
4
5
6
string make_random_str(uint length)
{ 
  string str;
  for (uint i=0;i<length;i++)str+='a'+rand()%26;
  return str;
}
hey athar
thanks a lot!
Topic archived. No new replies allowed.