I want to change because am learning c++ not C...but here we are at learning how to remove salt and pepper noise from an image and the good teacher decided it was all right to give us the example in C...although we've been learning c++.....I just dont have the time to go back learning C...exams is in 3 weeks...if i can have the code in c++, i can learn quickly my thing and later on in life worry about how to do it too in c...thanks...
It's not much different in C++, it just looks prettier. Also, converting this from C to C++ sounds a lot like an assignment, and I'm not at liberty to do an assignment for someone else. Even if this isn't an assignment, your teacher probably doesn't want you to focus too much on the file I/O, just the algorithm.
IS NOT AN ASSIGNMENT!!! why should you tell me what is it? am learning on my own...! is it normal to you to be studying c and c++ at the same time? IS NOT AN ASSIGNMENT! IF you wont help move on...!!! am saying am into c++ never been in c...i have to to this salt and pepper correction thing in c++ but unfortunately this was given as an example..but is in c...if you cant help just roll...pffffffffffff am asking for the code to be translated in c++..so i see the procedure because reading the thing in c doesnt make much sense to me cause i don't know c syntax although similar..but i still dont know it..thats all...
it just funny why you want to take the liberty to tell me what is good for me...no helping hand..but talking loads..thats what you doing..soo annoying
Calm down; panicking doesn't help. I'm being completely and utterly useless because this is something you need to learn. Learning C++ involves learning how to read and possibly convert to/from C code; it is actually an important skill that people pay for.
If I just did it for you for free, it wouldn't help you in any way. You need to learn the process of looking up the thing in C and figuring out what the equivalent C++ code is. The very first post I gave you did this for you, you just needed to connect the dots and apply it to this.
You can't expect people to go out of their way to make your life easier, unless they're your parents, in which case that's their job.
Also, read my posts slowly - it seems like you just skimmed my last post out of frustration.
SO LEMME PUT IT THIS WAY...the teacher should have loaded the example in c++...but he was not having a copy in c++ so he loaded a copy in C online...can you help? why dont you just help instead of minding too much of my business? hahahahaha
Your kindness will surely get you a lot of answers.
Did you ever use fstreams? If yes then you can get the conversion done within tonight.
fopen() is like fstream::open(). The string is the equivalent of openmode flags
fread() is like fstream::read(), except fread can read data of any width, not only chars.
You get the idea? It wasn't hard, was it?
hahaha thank you maeriden...sorry but L B was really getting me nervous...you are the right guy..no talking too much..straight to the point..practical people..thanks... :D am already seeing some light...thanks again
I just followed the links he posted to check the difference in parameters. I never touched file IO in C but it took me 5 minutes. Usually I would have replied in the same way as LB but I went out of my way a little since we're from the same country. I can understand being frustrated at bad teachers but honestly you didn't deserve the help after those replies.
Ah, mi spiace. Vivere in Italia è una cosa che non auguro mai a nessuno. Anzi ti è andata bene che sei a Milano, io vivo in terronia. Ho buttato tre anni nella schifosa ingegneria informatica che abbiamo qua senza manco dare un esame.
La punta di diamante delle mie lamentele è il professore di geometria, che ogni tanto gli prendeva di parlare in dialetto mentre spiegava. Certa gente fuori corso di due anni non poteva prendere la laurea perchè gli mancava solo la sua materia (che si fa al primo anno). Sembrava di avere Benigni come professore meno la comicità.
Poi c'è stata la volta che quelli di ing elettronica hanno dovuto seguire il corso di C con noi perchè non avevano il professore, ed eravamo 250 studenti in un'aula da 150.
Nessuno dei professori usava un microfono (e vabbè che l'impianto audio dell'aula era rotto) e 3 su 5 non si sentivano oltre la metà dell'aula.
Programma a mio parere poco efficiente (analisi1 12 crediti e analisi2 6 crediti, obbligatorie. All'università di Padova analisi1 è 9 crediti e analisi2 è facoltativa). Va bene che la matematica serve, però io volevo programmare cazzo.
La porta d'ingresso al dipartimento di ing energetica è stata rotta da qualcuno e ci hanno messo tipo 6 mesi per cambiarla.
Oltretutto ci stavo 40 minuti ad arrivare e le lezioni erano sempre alle 8 di mattina. Non sono mai stato famoso per sapermi alzare presto.