#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(){
char name[80];
char *searchptr;
int i, t;
for(i=1; name[i]!=EOF; i++){
printf( "Enter name\n");
scanf("%s", &name[i]);
}
for(t=i; t<=0; t--){
printf(" name[%d] == %s", i, name[t]);
getch();
return 0;
}}
romaineo
0
Newbie Poster
Recommended Answers
Jump to Posthelp plz, i am trying to input some names and then output them
I suggest using a 2D character array
@ line 12:
1. array indexes start at 0
2. since your not using files why use EOF? do yo expect that the user would input a negative value? …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.