hello guys i want to print the first n characters of a string where n can be variable in cpp. is there a function that can return the above mentioned string or can directly print it. if not help me formulate the relevant code. i want to print the entire string in width of say 20 using setw function. so please answer me accordingly. as i want the the output in width of 20 for loop cannot be used.