Solved

loop through int values

Posted on 2014-09-05
3
168 Views
Last Modified: 2014-09-06
#include <stdio.h>
#include <string.h>

main()
{
	int A[] = { 2, 4, 5, 8, 1 };
	int j;
	int valueAj;
	for (j = 0; j<5; j++)
	{
		valueAj = A[j];
       }

Open in new window



for another example, I want to know why the visual studio express is saying
            valueAj = A[j];
is an error


I do not want new code to solve a loop problem
I want to know or modify this code to work.
0
Comment
Question by:rgb192
3 Comments
 
LVL 5

Accepted Solution

by:
Sapa earned 250 total points
ID: 40307120
It seems like you missed a closed brace
0
 
LVL 9

Assisted Solution

by:macarrillo1
macarrillo1 earned 250 total points
ID: 40307134
Is there a closing brace for main()?

As in :

main ()
{


}<-----Here

I see the closing brace for the for loop.
0
 

Author Closing Comment

by:rgb192
ID: 40307662
closing brace

Thanks.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now