Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to run the program

Status
Not open for further replies.

thescoer

Programmer
Feb 15, 2006
3
GB
read and print an image C Languages .


output from the program should go to (stdout) (using printf statements) NOT stderr.

run-length encoding for the image
78 26 3 1 364 0 4 1 7 0 3 1 43 2 7 1 12 0 7 1 4 0 6 1 33 2 29 0 2 2 2 0 2 1 5 0 1 2 2 0 1 1 31 2 27 0 6 2 14 1 28 2 28 0 7 2 5 0 4 2 4 0 2 2 1 1 26 2 29 0 7 2 4 0 4 2 6 0 2 2 1 1 27 2 26 0 9 2 15 1 29 2 25 0 9 2 9 0 4 2 1 1 29 2 27 0 9 2 12 1 28 0 5 2 24 0 11 2 4 0 3 1 30 0 11 2 19 0 12 2 2 0 8 1 25 0 17 2 15 0 10 2 1 0 17 1 17 0 21 1 13 0 9 1 3 0 14 1 17 0 11 1 2 0 8 1 15 0 9 1 10 0 4 1 19 0 9 1 4 0 7 1 18 0 9 1 31 0 8 1 5 0 6 1 21 0 9 1 28 0 8 1 6 0 5 1 25 0 7 1 28 0 7 1 5 0 8 1 24 0 3 1 332

run the program but still Iam get error
 
Well, you could post the code you have, and the error messages.

Please use [code][/code] tags when posting code, so it looks like this
Code:
int main ( ) {
  return 0;
}
Also, state your OS and compiler.

--
 
#include <stdio.h>

main()
{

int width;
int height;
int greylevels;
int pix1;
int len1;
int pix2;
int M==0;

scanf("%i" ,width);
scanf("%i" ,height);
scanf("%i" ,greylevels);


while( scanf("%i",&pix1)!= EOF )


{

if (pix1 ==0)
{

putchar ('#');
}
else if(pix1 ==1)
{

putchar ('.');
}
else if(pix1 == 2)
{

putchar (' ');
}


/* if (M++)
'M'= width;
putcahr('\n');*/
'M'==0


}
return 0;

}
 
Well, you're obviously incapable of following my basic instructions like
- use code tags
- state OS/Compiler.
Neither of which are evident in your post.

--
 
Salem said:
Please use
Code:
tags when posting code, so it looks like this

Which part of that did you not understand ? Did you just read the first line of Salem's post, and paste the code in without reading the rest ?

You have not stated your OS/compiler, as requested by Salem, nor have posted the errors you are getting !

If you cannot learn to help us to help you, then I don't really see the point of you participating in forums such as this !

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top