Reversing a string in C

If you want to practice advanced features of C, how about pointers? We can toss in macros and xor-swap for fun too! A pointer (e.g. char *, read from right-to-left as a pointer to a char) is a data type in C that is used to refer to location in memory of another value. In this case, the location where … Read more

Variable warning set but not used

none shows up twice in this code snippet: And then: If, for example, you later had: or or something to that effect, we would say none is “used”, but as the code is, you have: “none” set but not used; exactly what the compiler said. In the pastebin link I see your problem: You wrote this: You meant to write this: … Read more

How do I concatenate const/literal strings in C?

In C, “strings” are just plain char arrays. Therefore, you can’t directly concatenate them with other “strings”. You can use the strcat function, which appends the string pointed to by src to the end of the string pointed to by dest: Here is an example from cplusplus.com: For the first parameter, you need to provide the destination buffer itself. The destination buffer must … Read more

Constant pointer vs Pointer to constant

declares ptr a pointer to const int type. You can modify ptr itself but the object pointed to by ptr shall not be modified. While declares ptr a const pointer to int type. You are not allowed to modify ptr but the object pointed to by ptr can be modified. Generally I would prefer the declaration like this which make it easy to read and understand (read from right to left):

casinojojobetpulibet girişOnwin Güncel Giriştürkçe altyazılı pornocanlı bahis casinocanlı bahis casino siteleriOnwin Güncel Girişcasinoholiganbet girişholiganbet güncel giriş