#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string.h>
using namespace std;
//creates a slight delay in drawing each character
void sleep(int sleep_time){
for(sleep_time;sleep_time == 0;sleep_time--){}}
void draw_text_char(string str_text){
//string used to hold the next character to be drawn
string current_text[strlen(str_text)];
//the overall length of the string to be drawn. Used so the for statement stops at the end of
//the string.
int string_length = strlen(str_text);
//the current character value being drawn. This extends the string to be drawn to one more
//character.
int current_char = 0;
//this is used to draw the text.
for(current_char; current_char == string_length; current_char++){
//clears the screen
system("cls");
//copies the string to be drawn up to the point designated by current_char.
//current_char is also used to designate the index in which the new string will be drawn.
strncopy(current_text[current_char],str_text,current_char);
//draws the new string
cout << current_text[current_char];
//give a small wait time
sleep(20);
}}
int main(){
draw_text_char("0001010010010001001001010010010");}
This is to create a function that draws a string one character at a time. I am currently using Dev-C++ (4.9.8.0) IDE, and it's returning an error with the string editing functions, and the array. I'm not quite sure what I'm doing wrong, but since I made the error I guess I wouldn't see it. Can anyone tell me what's wrong with this script?