Posts in 2021
-
Most votes on css questions 2
May 01, 2021 in FAQ
Most votes on css questions 2. #11 How do I give text or an image a transparent background using CSS? #12 How can I transition height: 0; to height: auto; using CSS? #13 How to make a div 100% height of the browser window #14 How can I make a div not larger than its contents? #15 Make a div fill the height of the remaining screen space #16 What's the difference between SCSS and Sass? #17 How to change the cursor into a hand when a user hovers over a list item? #18 Vertically align text next to an image? #19 How do CSS triangles work? #20 How to align checkboxes and their labels consistently cross-browsers
Read all the top votes questions and answers in a single page. #11: How do I give text or an image a transparent background using CSS? (Score: 2372) Created: 2009-04-30 Last updated: 2016-04-18 Tags: html, css, opacity Is it possible, using CSS only, …
-
Most votes on css questions 10
May 01, 2021 in FAQ
Most votes on css questions 10. #91 How to apply !important using .css()? #92 When to use IMG vs. CSS background-image? #93 Using jQuery to center a DIV on the screen #94 Angular: conditional class with *ngClass #95 Flexbox: center horizontally and vertically #96 What is sr-only in Bootstrap 3? #97 Remove border from IFrame #98 Remove IE10's "clear field" X button on certain inputs? #99 How to center a "position: absolute" element #100 Text-align class for inside a table
Read all the top votes questions and answers in a single page. #91: How to apply !important using .css()? (Score: 780) Created: 2010-04-16 Last updated: 2017-04-11 Tags: javascript, jquery, html, css I am having trouble applying a style that is …
-
Most votes on css questions 1
May 01, 2021 in FAQ
Most votes on css questions 1. #1 How to disable text selection highlighting #2 How to horizontally center an element #3 Change a HTML5 input's placeholder color with CSS #4 Is there a CSS parent selector? #5 Set cellpadding and cellspacing in CSS? #6 Is it possible to apply CSS to half of a character? #7 How do I disable the resizable property of a textarea? #8 I need an unordered list without any bullets #9 When to use margin vs padding in CSS #10 How do I vertically center text with CSS?
Read all the top votes questions and answers in a single page. #1: How to disable text selection highlighting (Score: 5520) Created: 2009-05-05 Last updated: 2020-09-08 Tags: css, cross-browser, highlight, textselection For anchors that act like …
-
Most votes on c++ questions 9
May 01, 2021 in FAQ
Most votes on c++ questions 9. #81 Is there a standard sign function (signum, sgn) in C/C++? #82 Why should we typedef a struct so often in C? #83 How to allocate aligned memory only using the standard library? #84 How can one print a size_t variable portably using the printf family? #85 Undefined reference to pthread_create in Linux #86 Difference between a Structure and a Union #87 Why is the use of alloca() not considered good practice? #88 Why do all the C files written by my lecturer start with a single # on the first line? #89 Static linking vs dynamic linking #90 How does free know how much to free?
Read all the top votes questions and answers in a single page. #81: Is there a standard sign function (signum, sgn) in C/C++? (Score: 446) Created: 2009-12-14 Last updated: 2009-12-24 Tags: c++, c, math I want a function that returns -1 for negative …
-
Most votes on c++ questions 8
May 01, 2021 in FAQ
Most votes on c++ questions 8. #71 What's the best way to check if a file exists in C? #72 Is there a printf converter to print in binary format? #73 What are .a and .so files? #74 Convert char to int in C and C++ #75 What is Linux’s native GUI API? #76 Why is volatile needed in C? #77 Why are hexadecimal numbers prefixed with 0x? #78 How many levels of pointers can we have? #79 What is the difference between float and double? #80 What are the barriers to understanding pointers and what can be done to overcome them?
Read all the top votes questions and answers in a single page. #71: What's the best way to check if a file exists in C? (Score: 481) Created: 2008-10-23 Last updated: 2019-02-22 Tags: c, filesystems, cross-platform Is there a better way than simply …
-
Most votes on c++ questions 7
May 01, 2021 in FAQ
Most votes on c++ questions 7. #61 How would one write object-oriented code in C? #62 How to initialize a struct in accordance with C programming language standards #63 Programmatically find the number of cores on a machine #64 When is assembly faster than C? #65 What is an unsigned char? #66 Is there a performance difference between i++ and ++i in C? #67 Typedef function pointer? #68 Debug vs Release in CMake #69 Preventing console window from closing on Visual Studio C/C++ Console application #70 C pointer to array/array of pointers disambiguation
Read all the top votes questions and answers in a single page. #61: How would one write object-oriented code in C? (Score: 514) Created: 2008-12-09 Last updated: 2019-12-30 Tags: c, oop, object What are some ways to write object-oriented code in C? …
-
Most votes on c++ questions 6
May 01, 2021 in FAQ
Most votes on c++ questions 6. #51 Why are #ifndef and #define used in C++ header files? #52 Calling C/C++ from Python? #53 What is the printf format specifier for bool? #54 What is the difference between char s[] and char *s? #55 What is the argument for printf that formats a long? #56 How do I list the symbols in a .so file #57 Correct format specifier for double in printf #58 Why does sizeof(x++) not increment x? #59 Fastest way to check if a file exist using standard C++/C++11/C? #60 unsigned int vs. size_t
Read all the top votes questions and answers in a single page. #51: Why are #ifndef and #define used in C++ header files? (Score: 557) Created: 2009-10-31 Last updated: 2019-07-25 Tags: c++, c, c-preprocessor I have been seeing code like this usually …
-
Most votes on c++ questions 5
May 01, 2021 in FAQ
Most votes on c++ questions 5. #41 How to generate a random int in C? #42 Which is faster: while(1) or while(2)? #43 Difference between static and shared libraries? #44 makefile:4: *** missing separator. Stop #45 Why does ENOENT mean "No such file or directory"? #46 What does "dereferencing" a pointer mean? #47 Why does printf not flush after the call unless a newline is in the format string? #48 What REALLY happens when you don't free after malloc? #49 Undefined, unspecified and implementation-defined behavior #50 What is a "static" function in C?
Read all the top votes questions and answers in a single page. #41: How to generate a random int in C? (Score: 599) Created: 2009-05-04 Last updated: 2018-07-14 Tags: c, random Is there a function to generate a random int number in C? Or will I have …
-
Most votes on c++ questions 4
May 01, 2021 in FAQ
Most votes on c++ questions 4. #31 What is size_t in C? #32 Divide a number by 3 without using *, /, +, -, % operators #33 How do you pass a function as a parameter in C? #34 What is a segmentation fault? #35 Can code that is valid in both C and C++ produce different behavior when compiled in each language? #36 How do I detect unsigned integer multiply overflow? #37 How can I get the list of files in a directory using C or C++? #38 How to determine CPU and memory consumption from inside a process? #39 "static const" vs "#define" vs "enum" #40 Why is “while ( !feof (file) )” always wrong?
Read all the top votes questions and answers in a single page. #31: What is size_t in C? (Score: 694) Created: 2010-03-31 Last updated: 2013-12-11 Tags: c, int, size-t I am getting confused with size_t in C. I know that it is returned by the sizeof …
-
Most votes on c++ questions 3
May 01, 2021 in FAQ
Most votes on c++ questions 3. #21 typedef struct vs struct definitions #22 Unit Testing C Code #23 What is the strict aliasing rule? #24 Why are these constructs using pre and post-increment undefined behavior? #25 Why use apparently meaningless do-while and if-else statements in macros? #26 Difference between malloc and calloc? #27 Using boolean values in C #28 What should main() return in C and C++? #29 Why isn't sizeof for a struct equal to the sum of sizeof of each member? #30 Speed comparison with Project Euler: C vs Python vs Erlang vs Haskell
Read all the top votes questions and answers in a single page. #21: typedef struct vs struct definitions (Score: 891) Created: 2009-11-04 Last updated: 2018-12-04 Tags: c, struct, typedef I’m a beginner in C programming, but I was wondering …