<< < 157 158 159 160 161 162 163 164 165 166 167 > >>   Sort: Date

What is the maximum length of a varchar in SQL Server?
What is the maximum length of a varchar in SQL Server? Answer1 VARCHAR[(n)] Null-terminated Unicode character string of length n, with a maximum of 255 characters. If n is not supplied, then 1 is assumed. Answer2 8000 Answer3 The business logic is the aspx.cs or the aspx.vb where the code is being w...
2014-09-15, 1428👍, 0💬

Explain features of SQL Server like Scalibility, Availability, Integration with Internet.
Explain features of SQL Server like Scalibility, Availability, Integration with Internet. Scalibility - The same Microsoft SQL Server 2000 database engine operates on Microsoft Windows 2000 Professional, Microsoft Windows 2000 Server, Microsoft Windows 2000 Advanced Server, Windows 98, and Windows M...
2014-10-27, 1425👍, 0💬

How do I round numbers?
How do I round numbers? The simplest and most straightforward way is with code like (int)(x + 0.5) C's floating to integer conversion truncates (discards) the fractional part, so adding 0.5 before truncating arranges that fractions &gt;= 0.5 will be rounded up. (This technique won't work properl...
2015-06-26, 1424👍, 0💬

What is the difference between memcpy and memmove?
What is the difference between memcpy and memmove? memmove offers guaranteed behavior if the memory regions pointed to by the source and destination arguments overlap. memcpy makes no such guarantee, and may therefore be more efficiently implementable. When in doubt, it's safer to use memmove. It se...
2015-07-16, 1422👍, 0💬

y program is crashing, apparently somewhere down inside malloc ....
My program is crashing, apparently somewhere down inside malloc, but I can't see anything wrong with it. Is there a bug in malloc? It is unfortunately very easy to corrupt malloc's internal data structures, and the resulting problems can be stubborn. The most common source of problems is writing mor...
2016-04-06, 1418👍, 0💬

How does free know how many bytes to free?
How does free know how many bytes to free? The malloc/free implementation remembers the size of each block as it is allocated, so it is not necessary to remind it of the size when freeing. (Typically, the size is stored adjacent to the allocated block, which is why things usually break badly if the ...
2016-03-24, 1416👍, 0💬

Which of the following is the C# escape character for Null?
Which of the following is the C# escape character for Null? Which of the following is the C# escape character for Null? * \n * \0 * \f * \v \0
2014-08-06, 1416👍, 0💬

How can I determine whether a machines byte order is big-endian or little-endian?
How can I determine whether a machines byte order is big-endian or little-endian? The usual techniques are to use a pointer: int x = 1; if(*(char *)&amp;x == 1) printf("little-endian\n"); else printf("big-endian\n"); or a union: union { int i; char c[sizeof(int)]; } x; x.i = 1; if(x.c[0] == 1) p...
2015-02-16, 1408👍, 0💬

How can I print a character in a printf format string?
How can I print a '%' character in a printf format string? I tried \%, but it didn't work. Simply double the percent sign: %% . The reason it's tricky to print % signs with printf is that % is essentially printf's escape character. Whenever printf sees a %, it expects it to be followed by a characte...
2015-11-09, 1407👍, 0💬

I have a program which mallocs and later frees a lot of memory ...
I have a program which mallocs and later frees a lot of memory, but I can see from the operating system that memory usage doesn't actually go back down. Most implementations of malloc/free do not return freed memory to the operating system, but merely make it available for future malloc calls within...
2016-03-28, 1406👍, 0💬

If I have a char * variable pointing to the name of a function ...
If I have a char * variable pointing to the name of a function, how can I call that function? Code like extern int func(int, int); char *funcname = "func"; int r = (*funcname)(1, 2); or r = (*(int (*)(int, int))funcname)(1, 2); doesn't seem to work. By the time a program is running, information abou...
2015-02-20, 1405👍, 0💬

How do you use DBCC statements to monitor various ASPects of a SQL Server installation?
How do you use DBCC statements to monitor various ASPects of a SQL Server installation? Database Consistency Checker (DBCC) - Is a statement used to check the logical and physical consistency of a database, check memory usage, decrease the size of a database, check performance statistics, and so on....
2014-10-20, 1404👍, 0💬

What is the use of trace utility?
What is the use of trace utility? Tracing is a very important monitoring and debugging tool for distributed, multitier applications. Such applications often contain problems that can only be observed when the application is under a heavy load and the inherent randomness of a real-life environment. T...
2014-11-10, 1399👍, 0💬

What is a good way to check for ``close enough'' floating-point equality?
What is a good way to check for ``close enough'' floating-point equality? Since the absolute accuracy of floating point values varies, by definition, with their magnitude, the best way of comparing two floating point values is to use an accuracy threshold which is relative to the magnitude of the nu...
2015-06-26, 1398👍, 0💬

How do I send escape sequences to control a terminal or other device?
How do I send escape sequences to control a terminal or other device? If you can figure out how to send characters to the device at all , it's easy enough to send escape sequences. In ASCII, the ESC code is 033 (27 decimal), so code like fprintf(ofd, "\033[J"); sends the sequence ESC [ J . Some prog...
2015-04-20, 1398👍, 0💬

What is C language?
What is C language? The C programming language is a standardized programming language developed in the early 1970s by Ken Thompson and Dennis Ritchie for use on the UNIX operating system. It has since spread to many other operating systems, and is one of the most widely used programming languages. C...
2014-12-31, 1398👍, 0💬

Why isn't a pointer null after calling free? ...
Why isn't a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it's been freed? When you call free, the memory pointed to by the passed pointer is freed, but the value of the pointer in the caller probably remains unchanged, because C's pass-by-value sem...
2016-04-04, 1389👍, 0💬

When I call malloc to allocate memory for a pointer which is local to a function ....
When I call malloc to allocate memory for a pointer which is local to a function, do I have to explicitly free it? Yes. Remember that a pointer is different from what it points to. Local variablesare deallocated when the function returns, but in the case of a pointer variable, this means that the po...
2016-03-31, 1388👍, 0💬

How can I split up a string into whitespace-separated fields?
How can I split up a string into whitespace-separated fields? How can I duplicate the process by which main() is handed argc and argv? The only Standard function available for this kind of ``tokenizing'' is strtok, although it can be tricky to use and it may not do everything you want it to. (For in...
2015-08-17, 1382👍, 0💬

Why wont the Frobozz Magic C Compiler ...
Why won't the Frobozz Magic C Compiler, which claims to be ANSI compliant, accept this code? I know that the code is ANSI, because gcc accepts it. Many compilers support a few non-Standard extensions, gcc more so than most. Are you sure that the code being rejected doesn't rely on such an extension?...
2015-11-25, 1381👍, 0💬

How can printf use f for type double, if scanf requires lf?
Someone told me it was wrong to use %lf with printf. How can printf use %f for type double, if scanf requires %lf? It's true that printf's %f specifier works with both float and double arguments Due to the ``default argument promotions'' (which apply in variable-length argument lists values of type ...
2015-11-06, 1381👍, 0💬

Here is a good puzzle: how do you write a program which produces its own source code as output?
Here is a good puzzle: how do you write a program which produces its own source code as output? It is actually quite difficult to write a self-reproducing program that is truly portable, due particularly to quoting and character set difficulties. Here is a classic example (which ought to be presente...
2015-01-02, 1378👍, 0💬

I figured I could use scanf more safely if I checked its ...
I figured I could use scanf more safely if I checked its return value to make sure that the user typed the numeric values I expect: int n; while(1) { printf("enter a number: "); if(scanf("%d", &amp;n) == 1) break; printf("try again: "); } printf("you typed %d\n", n); but sometimes it seems to go...
2015-10-19, 1376👍, 0💬

What does the message warning macro replacement within a string literal mean?
What does the message warning macro replacement within a string literal mean? Some pre-ANSI compilers/preprocessors interpreted macro definitions like #define TRACE(var, fmt) printf("TRACE: var = fmt\n", var) such that invocations like TRACE(i, %d); were expanded as printf("TRACE: i = %d\n", i); In ...
2015-12-14, 1368👍, 0💬

<< < 157 158 159 160 161 162 163 164 165 166 167 > >>   Sort: Date