Ilya
In this code when i am fixing the values of x and y at compile time then i am getting x= 31 and y= 21 But if i scan the values of x and y at run time then i am getting x= 11 and y= 21
This is a well known case of undefined behavior. That is, this code is wrong, incorrect. But the compiler is not obliged to check this, and must compile the code well and produce executable, which will work in this case unpredictably. The bad pice of code is x = x++ + y++; You cannot modify one variable, x in this case, more then once in one statement before one sequence point happens, ; in this case. Two modifications of x , caused by assignment and by increment, may happen in any arbitrary order, and final value of x is undefined. This happens independently on the way you enter values of x and y in the previous statement.
LastPahlawan
i am curious why when i want to call a function ,the function need to be upper of the function of calling ? Like : void test(){ } void test1(){ test(); } test need to be above test 1
Spirit
Not defined
Spirit
I'm not positive but I think it's for the preprocessor/lexer or whatever because the compiler is gonna need to know that a function named test exists so I'm guessing it can be linked together properly
LastPahlawan
Just needs to be declared first
because now i use c to program mcu nrf52840 using segger IDE. when i put it under the other function it cannot detect the function. usually compiler will give suggestion function as we type. so strangeee
Spirit
"The required behaviour of C89 when encountering a function call for which no definition or prototype is available is to assume that it returns an int and has the number and types of the arguments that you supply in the call. If you subsequent call it with different argument types that cannot be legally implicitly cast, or a different number of arguments, the compiler will reject the code. The compiler or linker will complain when it eventually finds a mis-matching definition. The use of a prototype allows the compiler to generate the error at the call rather than the definition, of when trying to link the definition from another module. So in short don't do it if you want the compiler to help you write working code! In C99 and C++ prototypes are required if the definition is not already visible. "
Ilya
i am curious why when i want to call a function ,the function need to be upper of the function of calling ? Like : void test(){ } void test1(){ test(); } test need to be above test 1
It does not need this. To call a function, it has to be declared first, before calling, but does not need defining. That is, you can only declare the function, but define it later in the source file or even in another source file. This is what we have in C++. In classic C you even don't need to declare a function, the call just will not be checked on correctness of the parameters. You needed to put your function upper in the file only because you don't you separate pre declaration of the function. But definition of function is always also a declaration, hence the compiler can use this function lower in the file
LastPahlawan
but i dont understand the pre declaration of the function. anyway will google it.
Dharmendra
Hi there! Join TimesPoints using my referral link & earn 100 Bonus Points. Click here https://www.timespoints.com/refer-earn?referral_code=DQNNRX to join. #TimeIsMoney with TimesPoints!
Ilya
but i dont understand the pre declaration of the function. anyway will google it.
You declare a function and since this point you can use it.
Anonymous
What is the best channel on YouTube to learning programming?
Anonymous
Or free course on internet
klimi
Another one bites the dust...! Banned Muskan Mona. Reason: Scam, spam
Th -⃝.-mas
Heyy !!
Anonymous
hii
Th -⃝.-mas
hii
Heyy !!
Anonymous
hello
Th -⃝.-mas
hello
Heyy !!
Anonymous
What is the best channel on YouTube to learning programming?
Anonymous
how ar u
Anonymous
Please
Anonymous
apni kaksha of aman dhattarw
Anonymous
Oh I am sorry
Anonymous
Harshita voshnoi
Esha
What is the best channel on YouTube to learning programming?
YouTube channel name :Apni kaksha of Aman dhattarwal
Anonymous
But I can not understand his language
Anonymous
I want a English channel
Anonymous
To learn HTML firstly
Anonymous
then go for udemy or udacity
Anonymous
Plz
Anonymous
for HTML also udemy and udacity is best ,i consider udemy more
Anonymous
Oh
Anonymous
That's good
Anonymous
OK
Anonymous
And is there any channel to learn visual basic?
Esha
Udemy has courses for that too
Esha
Or go for EDX
András
Or go for EDX
Oh, I hoped that assembly is discussed here
Maksym
hey guys. how to handle threads which do same action but with different time(or name of such method)? For example: threads geting file names and then writing file's(very thread have different file to read but same database) data into database. How to effectivly manage work of threads??
Ludovic 'Archivist'
I like garbled English in the morning
Esha
Oh, I hoped that assembly is discussed here
What did you mean. . May I know??
Sarbajit Ghosh (সর্বজিৎ ঘোষ)
.
Sarbajit Ghosh (সর্বজিৎ ঘোষ)
Is there any database books out there where treatment is given in c programming. Actually I am designing a student database program of a school, with 12 different classes and i want to use tree data structure there.
Dima
googleit lmao
Sarbajit Ghosh (সর্বজিৎ ঘোষ)
I have Google it a lot. There is no book which exclusively deals c programming on database design. Most book talks about SQL language. And at maximum how to connect SQL and c language. But I want to do it exclusively in c language. I do not want to take help of SQL or Oracle or any other database languages.
Anonymous
hi
Sarbajit Ghosh (সর্বজিৎ ঘোষ)
I know 😭 But I have to start from a point.
Dima
I know 😭 But I have to start from a point.
I’d recommend you learning sockets and tcp/ip overall first
Dima
this is how database connects (usually) to client and transfers data
Jobin
How can we make predefined string mutable in C
Dima
you better do this in c++
Anonymous
To learn HTML firstly
Traversy media YouTube
Sarbajit Ghosh (সর্বজিৎ ঘোষ)
Treatment of what?
How to create a student database using tree structure in c of several classes with several sections.
Dima
just use your logic lol
Sarbajit Ghosh (সর্বজিৎ ঘোষ)
just use your logic lol
I did not ask you.
Dima
idc
Sarbajit Ghosh (সর্বজিৎ ঘোষ)
idc
Shuy up
Dima
Shuy up
/warn what’s wrong with your behaviour
Sarbajit Ghosh (সর্বজিৎ ঘোষ)
~t
Sarbajit Ghosh (সর্বজিৎ ঘোষ)
/warn what’s wrong with your behaviour
/warn you not behaving well
Dima
you really want to get the second one?
I_Interface
/warn you not behaving well
/warn watch your tone with ppl, esp with admin,
Dima
lol I wanted to keep him
Dima
Dima
OK
Dima
well at least I tried to help him but he seems to be silly