difference between tab ,space and blank in C?

I came across the following code in Ritchie and kernighan C,for counting no. of words .. #include<stdio.h> #d...

strstr() function like, that ignores upper or lower case?

I have two strings. Lets say ` str1="One Two Three"; and str2="two"; I would like to know if there is any fun...

Order of matrix multiplications in OpenGL?

glDisable(GL_DEPTH_TEST); glViewport(0/*left*/, 0/*botton*/, 200/*width*/, 200/*height*/); //T4 glMatrixMode(GL_P...

Initialize a string in C to empty string?

I want to initialize string in C to empty string. I tried: string[0] = ""; but it wrote "warning: assignment ma...

String Padding in C?

I wrote this function that's supposed to do StringPadRight("Hello", 10, "0") -> "Hello00000". char *StringPadRig...

Using Exclamation Marks '!' in C?

I have come across a problem involving exclamation marks and integers whilst reading a code in my reference book. L...

What is the simplest way to render a 3D cube with a single lighting source??

Depicted below is a crappy Photoshop mockup of a three-dimensional cube. Here are my parameters: The solution mus...

Can I display the value of an enum with printf()??

Is there a one-liner that lets me output the current value of an enum? ...

How to print a int64_t type in C?

C99 standard has integer types with bytes size like int64_t. I am using the following code: #include <stdio.h&gt...

How can I print a quotation mark in C??

In an interview I was asked Print a quotation mark using the printf() function I was overwhelmed. Even in thei...

Approximating Sine(x) with a Taylor series in C and having a lot of problems?

I'm trying to approximate sine(x) in C using a Taylor series and Stirling's approximation for factorials but I'm ge...

Implementing Taylor Series for sine and cosine in C?

I've been following the guide my prof gave us, but I just can't find where I went wrong. I've also been going throu...

How to list all the possible binary search trees with n nodes??

I want to list all the possible binary search trees. I know that the number will be the catalan number. But i want t...

Is there a one-line function that generates a triangle wave??

In a similar way that modulo generates a sawtooth wave. It doesn't have to be continuous. here is what i mean: int...