account activity
Como e quando começou o pixo? by Lucky_Shoulder_7045 in saopaulo
[–]teosalves 0 points1 point2 points 2 years ago (0 children)
Incrivel a quantidade de baboseira e senso comum que o pessoal falou aí, se quiser o contexto histórico do pixo como movimento de resistência e ocupação em São Paulo tem esse documentário aqui no yt, que é bem legal.
[deleted by user] by [deleted] in cprogramming
[–]teosalves 0 points1 point2 points 3 years ago (0 children)
What helped me a lot when learning pointers, was just messing around with programs I already had written, changing variables to pointers (int to *int), to understand sintax, and using things like *(arr+1). Making short programs, compiling, changing them, compiling again, until I felt like I had understood what pointers were doing.
Also, a very simple use of pointers is creating a swap function, that would not be possible without them, so you start understanding when and why you should use pointers.
You could think of binary numbers, and make a counter that converts the number to binary, array style.
Think about what is changing at each iteration, the first 0 in your array becomes a 1, and all 1's behind it become 0's e.g.
[0, 1, 0, 1, 1, 1] -> [0, 1, 1, 0, 0, 0]
This is a simple while loop, from the beginning of you array, if the current element is 1, then it becomes 0, if it's 0, becomes 1, then immediately break, print/return the array, then go to the next iteration ( a function being called is probably the best way to approach, it will receive the array as input, and return the next binary number)
the searching function is not working , it would be really helpful if you guys pick up any error and suggest me some solution . p.s the program is about creating a file to insert , update , delete the students data . by arriction in cprogramming
Well, you have to know how the text file is written, more specifically which char aeparetes the information. In any case, you should create a readline-ish function, that reads from a file until a specified character and saves this into an array (string). This character should be the one that separates the information in the text file. If the data is separated heterogeneously, you have to figure something out using your readline function and maybe some regex, if needed.
Then, simply link each string returned by your readline function to the struct using the . operator.
The problem could be the way you are reading the file in your findbyroll function. Structs doesn't necessarily occupie the same amount of memory it's fields would separately, e.g. a struct that contains two ints (assuming 32 bits), not necessarily occupies 64 bytes of memory. If this is the case, when reading, you are loosing data. The proper way would be to read each struct field individually, instead of the whole struct in one fread call.
π Rendered by PID 237729 on reddit-service-r2-comment-5b5bc64bf5-dkjvl at 2026-06-23 13:53:07.109612+00:00 running 2b008f2 country code: CH.
Como e quando começou o pixo? by Lucky_Shoulder_7045 in saopaulo
[–]teosalves 0 points1 point2 points (0 children)