[SOLVED] find the max index in undefined array index

Status
Not open for further replies.

baby_1

Advanced Member level 1
Joined
Dec 3, 2010
Messages
415
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Activity points
4,277
Hello
in this program how can i find the max index in undefined array index?(Num variable)(i assume 200 that you can see the error);
Code:
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <math.h>
#include <string.h>

int i;
int baby(char num[]);
int main(void)
{    
baby("Hello");
     getch();
}

int baby(char num[])
{
for(i=0;i<200;i++)printf("%c",num[i]);
return 0;
}


---------- Post added at 19:27 ---------- Previous post was at 19:15 ----------

i Solved it
for(i=0;num;i++)printf("%c",num);
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…