Help programming

Im currently studying IT to create tzac proof cheats in the future but im already having some problems.

Im trying to create an easy form in C which you have to fill in in order to get your curriculum vitae


The current code can be found here:

http://pastebin.com/zuN6kR8d

Every time I run it, it randomly skips steps.

Anyone knows what the problem might cause? im working with Dev-C++
Comments
24
i would help you but your skill/ego ratio is too fucked up.
cant divide by zero
Parent
well, in case you are putting more than one char into each "field", than you will have problems with. you should make ur variables typed as char[] not char, char = 1 character, char[] = array of characters aka string. When you put string into char via scanf you can cause some memory leaks/inconsitencies which can lead into skipping another scanfs.
i dont understand you completely

i am indeed putting more than one character in the fields, but what do you mean with typing variables as char[]?
Parent
Char is 1 character.
When you use [ ] brackets, it means you have an array (or table) of characters.

But the easiest way to do what you are doing is to use strings.
Parent
Yes use strings. No limit.
Parent
I dont really see any effort of strings.
Lets take
char age;
,could use
char age[3];
to prevent trolls.
Parent
i would help you but your skill/ego ratio is too fucked up.
char naam, adres, telefoonnummer, email, nationaliteit, geboortedatum;

Those are chars, not char arrays or Strings. You're also asking for a char (%c) with scanf.
Char = 1 letter.

I haven't really played with C in ages, but perhaps http://pastebin.com/GjhFHXxF
the [80] is the size of the string right?
Parent
More or less right yes. char naam[80]; means its an array of 80 chars, you can put in 80 letters.
Parent
Hmm? naam[79] would contain the null termination character though? so effectively, he could use 79 characters if he would use char[80]?
Parent
Sounds correct. Like I said, I haven't touched C/C++ in years. And when I did touch it, I didn't get pass 1st base so my knowledge of the language is rather limited :P
Parent
omg it works, ive been googling for 30 minutes but something this simple didnt come by

thx!
Parent
wut = Date of birth ;)

thx for your version

btw, that [80] uses more memory than a lower number, right?
Parent
Should use,but personally havent noticed any bigger memory usage between 40 and 80
Parent
Technically yes but its not going to run a modern computer out of memory space, its trivial the difference :P
Parent
ask khaplja
i have no idea. ask chabilja

http://www.youtube.com/watch?v=6EHemagYSs8 no cudi no wiz no hiphop
Back to top