4/3/2023 0 Comments Scanf in cI suspect your basic problem is that your data has whitespace between each set of )(īut you don't have any part of the scanf that scans over the newlines. It helps get consistent answers in testing. Four raw arrays that share an index is the kind of thing that gave Fortran 66 a bad name.Īlso best to have your data in a file and redirect it, not type it each time. Personally, I would put charv, intv1, intv2, intv3 in a struct and read into an array of those structs. So you can afford to make xxx something descriptive. I know intv3 is a vector of ints because it is declared int xxx. Nicer to choose meaningful names for variables. How do you know you only get to scanf once? I see no debug! Best to list i, and each value set, at the time you read it, while developing code.Īlso, scanf returns a value: number of fields processed. But C indexes run from 0, so you should loop i = 0 i < 10 i++. (i, b and u are all bad things to index by.)Īlso post your declarations of charv, intv1, intv2, intv3. As there is no balancing, the markup is removed but the Italic is not done. (without the dots) is markup for Italic Font. So I can't tell whether you indexed by anything. First issue is that indexing by i in this forum interacts badly with mark-up.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |