| | |
String Array
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Dec 2005
Posts: 26
Reputation:
Solved Threads: 0
Hi guys…
I want to write small program in C printing three or more people in array..how? please write to me the syntax as I am very poor in C..
How to define the name? and accept the conformation from the user? Either by yes or no
The printing should be like
Your name is (first name in array)
Your name is (second name in array)
Do you need to use Loop?
I want to write small program in C printing three or more people in array..how? please write to me the syntax as I am very poor in C..
How to define the name? and accept the conformation from the user? Either by yes or no
The printing should be like
Your name is (first name in array)
Your name is (second name in array)
Do you need to use Loop?
first, you need to write main() function
next declare a character array that will hold the name that you input from the keyboard
call printf() to display the prompt, and fgets() to get the input from the keyboard.
C Syntax (Toggle Plain Text)
#include <stdio.h> int main() { // put your code here }
next declare a character array that will hold the name that you input from the keyboard
C Syntax (Toggle Plain Text)
#include <stdio.h> int main() { char name[80]; // allow up to 79 characters plus null terminator // put your code here }
call printf() to display the prompt, and fgets() to get the input from the keyboard.
C Syntax (Toggle Plain Text)
print("... < text goes here > ... "); fgets(name,sizeof(name),stdin);
•
•
Join Date: Dec 2005
Posts: 26
Reputation:
Solved Threads: 0
Hi Ancient,
Thanks for your help,
well, that slove first part of the probelm, i think i need to have a loop...
Assume, I have three elements in array – test[‘A’ , ‘B’ , ‘C’]
I want in the printf function to print this Question with each element
Are you Mr. A
Are you Mr, B
Are you Mr. C
Waiting your support
Thanks
Thanks for your help,
well, that slove first part of the probelm, i think i need to have a loop...
Assume, I have three elements in array – test[‘A’ , ‘B’ , ‘C’]
I want in the printf function to print this Question with each element
Are you Mr. A
Are you Mr, B
Are you Mr. C
Waiting your support
Thanks
![]() |
Similar Threads
- How do I convert a vector to a String array ? (Java)
- Declaring string array, initializing later... (C++)
- Copy string into an array (C#)
- ArrayList to multi-dimensional string array (C#)
- Geting elements from a String Array (C++)
Other Threads in the C Forum
- Previous Thread: A couple of ?s on algorithms. Help Plz
- Next Thread: C - Functions and arrays
| Thread Tools | Search this Thread |
#include * ansi append array arrays asterisks bash binarysearch centimeter changingto char character convert copyimagefile cprogramme creafecopyofanytypeoffileinc createprocess() database dynamic execv fgets file floatingpointvalidation fork framework function getlogicaldrivestrin givemetehcodez grade gtkwinlinux hacking histogram ide inches include infiniteloop initialization input interest intmain() iso kernel keyboard kilometer km license linked linkedlist linux list lists looping lowest matrix meter microsoft number oddnumber open opendocumentformat openwebfoundation overwrite owf pdf pointer pointers posix power probleminc process program programming radix recursion recv recvblocked research reversing segmentationfault sequential single socket socketprogramming standard strchr string suggestions systemcall test testing threads turboc unix urboc user variable wab whythiscodecausesegmentationfault windowsapi






