Talk:Introduction to computing: Difference between revisions

From Applied Science
No edit summary
Tag: wikieditor
No edit summary
Tag: wikieditor
Line 1: Line 1:
In the third algorithm I removed a phrase about the difference beween a program and a function, because it was confusing and not needed.
In the third algorithm in "commented exercises" I removed a phrase about the difference beween a program and a function, because it was confusing and not needed.


After reading again what I wrote about srand() I noticed that I made a mistake in the article about random numbers. How can srand() be of void type and at the same time I told that srand() returns some value? Corrected this confusion.
After reading again what I wrote about srand() I noticed that I made a mistake in the article about random numbers. How can srand() be of void type and at the same time I told that srand() returns some value? Corrected this confusion.

Revision as of 20:13, 23 January 2025

In the third algorithm in "commented exercises" I removed a phrase about the difference beween a program and a function, because it was confusing and not needed.

After reading again what I wrote about srand() I noticed that I made a mistake in the article about random numbers. How can srand() be of void type and at the same time I told that srand() returns some value? Corrected this confusion.

Added a short comment about the binary search algorithm. It may happen that someone looks at the table and notice the blank cells. Therefore, one may happen to think that some values from the array were erased. We are just searching, not erasing anything.

I made two small mistakes that I only noticed now. The sum of the arithmetic progression requires three variables to work with any sequence, not just 1 + 2 + ... + n. The function was defined as int, which means that if the result was non integer we would lose digits.

In the last algorithm the sum is an integer, but it's storing the result of a division of two integers. It's losing digits at each iteration. I also changed n from int to float because I think I confused the value of the variable with the value that the function returns.

I erased one phrase about the conditional operator. I may have made a confusiong betwee trading two commands by one. The conditional operator is a pair of two characters. I may have made a mistake in comparing two keywords with two characters.

Changed "The concept of pointers to struct is the same as pointer to any other variable". I gave the idea that struct is a variable, which contradicts other pages. Struct is a data type and you declare a variable with the type struct. I also changed the Note about the function that swaps all values of all members of two structs. The way I wrote it makes it very confusiong about what is a pointer, struct and a memory address.