i'm new to array. we were given this exercises to be solved:

but i have question about letters of ten elements, array integer which is called totals, contents of the character array called words, arrays elements and a lot of stuff that seems to be going with it. thank you.

can somebody please illustrate or post a sample of a function call with the following?

thank you so much for all your help. God bless!


1. declare a character - based array called letters of ten elements

2. assign the character value 'Z' to the fourth element of the letters array

3. use printf statement to print out the third element of an integer array called totals

4. use printf statement to print out the contents of the character array called words


give the C code of the ff. (each is independent of the other):

#define N 10
int i, a[N];

- initializing the elements of array a to zero
- assign the first element of array a to a value 100.
- assign the last element of array a to 50.
- assign the fifth element of array a to 10.
- assign the values 1 to 10 to the elements of array a.

Recommended Answers

All 2 Replies

You need to use strcpy.

#include<iostream>

char word[10];
strcpy(word,"Example");
cout<<word<<endl;

What code have you written so far? If you post the bits you have then people can help you to improve it so that it does what you want it to.

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.