Thread: need help with this code this please

  1. #1
    Registered User
    Join Date
    Nov 2017
    Posts
    2

    need help with this code this please

    please check the attached file i have to do that program
    would love some help please
    Attached Images Attached Images need help with this code this please-screen-shot-2017-11-02-11-29-46-jpg 

  2. #2
    Registered User
    Join Date
    Nov 2017
    Posts
    2
    98 114 112 100 112
    100 110 112 110 112
    100 110 124 110 123
    100 110 110 110 119
    90 110 100 110 111
    111 110 123 110 120
    100 99 111 155 113






    this is the content of the pixelsin.txt file

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,665
    I would suggest you start with the simpler program of copying pixelin.txt to pixelout.txt.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Banned
    Join Date
    Aug 2017
    Posts
    861
    what/where is your code? you need to have your code find the 110 number then just change it to 255, else every thing else is 0 (zero). Open file then loop through the (array) file with an if statement checking each "chunk of data" for the value of 110, change that to 255 else 0.
    Code:
    if (value[a] == 110)
          value[a] = 225;
    else
          value[a] = 0;
    do not forget your loop. where 'a' is the count var in this example. remember it is an example of the method, actual code may not be the same.

    do not forget to write that to an output file as well.

    Their is plenty of how to do every step of that out there in la la land. even in this place. Then if you get lost somewhere in that code, post back and I am sure someone will be happy to help you with it.
    basic steps.
    1. open file
    2. read file
    3. check data
    4. create new file
    5. write new values into a separate (new) file.
    6. close both files
    7. exit program
    8. check results in your new file.


    the creating of a new file, that step gets put where it is necessary. it might be more towards the top of that list, even.

    open file, if file open , hold on to it, then create a new file, then search your open file, write to your new file in the loop as you change the values. close both files when done. program could end there, or you could re-open new file print it out to the screen to see what you did to it. then shut down your program.

    formatting your output file I think will be the hardest part.
    Last edited by userxbw; 11-02-2017 at 07:32 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 09-19-2012, 01:58 PM
  2. Replies: 1
    Last Post: 03-10-2010, 11:28 AM
  3. producing c/c++ code from flowcharts,pseudo code , algorithims
    By rohit83.ken in forum C++ Programming
    Replies: 3
    Last Post: 02-20-2008, 07:09 AM
  4. Having trouble translating psudeo-code to real-code.
    By Lithorien in forum C++ Programming
    Replies: 13
    Last Post: 10-05-2004, 07:51 PM
  5. Replies: 0
    Last Post: 02-21-2002, 06:05 PM

Tags for this Thread