stackoverflow1453

Programming&&Games&&Life

Archive for August, 2013

CSGO Testing Flash and Smoke grenades

bind “MOUSE5” “sv_cheats 1; noclip; give weapon_hegrenade; give weapon_flashbang; give weapon_smokegrenade”

Tested Pricing Strategies

Pricing Strategies Summary! Must read

http://conversionxl.com/pricing-experiments-you-might-not-know-but-can-learn-from/#.

Satoshi Fumi – Orange Sky

Artist: Satoshi Fumi
Title: Orange Sky
Album: Sweet Sensation
Label: Klik Records
Year: 2008

How to use strstr()?

/*

Name:
Copyright: Deitel C How to Program
Author: StackOverflow1453
Date: 8/22/2013 4:34:52 PM
Description: How to use strstr()?

Function strstr searches for the first occurrence of its second string argument in its first
string argument. If the second string is found in the first string, a pointer to the location
of the string in the first argument is returned. Figure 8.28 uses strstr to find the string
"def" in the string "abcdefabcdef".


*/
#include <stdio.h>
#include <string.h>

int main(void){

	char *string1="Sisi is the #1 mass murderer, world has ever seen till big bang.";
	char *string2="ig";

	printf("%s \nin \n%s\n is: %s", string2, string1, strstr(string1, string2));

	getch();

}

How to use strspn()?

/*

Name:
Copyright: Deitel C How to Program
Author: StackOverflow1453
Date: 8/22/2013 3:17:29 PM
Description:How to use strspn()?

Function strspn (Fig. 8.27) determines the length of the initial part of the string in its
first argument that contains only characters from the string in its second argument. The
function returns the length of the segment.

*/
#include <stdio.h>
#include <string.h>

int main(void){

	char *string1="Sisi is the #1 mass murderer, world has ever seen till big bang.";
	char *string2="Sersian1 "; //space is checked also so you have to include space

	printf("The length of the initial segment of string1 containing only characters from string2 is %d.", strspn(string1, string2));

	getch();
}

How to use strrchr()?

/*

Name:
Copyright: Deitel C How to Program
Author: StackOverflow1453
Date: 8/22/2013 3:04:57 PM
Description: How to use strrchr()?

Function strrchr() searches for the last occurrence of the specified character in a string. If
the character is found, strrchr returns a pointer to the character in the string; otherwise,
strrchr returns NULL. Figure

*/
#include <stdio.h>
#include <string.h>

int main(void){

	char *string1="Sisi is the #1 mass murderer, world has ever seen till big bang.";
	char findChar='b';
	//prints remaining after the last occurrence of 's'
	printf("%s", strrchr(string1, findChar));

	getch();

}

How to use strpbrk()?

/*

Name:
Copyright: Deitel C How to Program
Author: StackOverflow1453
Date: 8/22/2013 2:52:57 PM
Description:

Function strpbrk searches its first string argument for the first occurrence of any character
in its second string argument. If a character from the second argument is found, strpbrk
returns a pointer to the character in the first argument; otherwise, strpbrk returns NULL.

*/
#include <stdio.h>
#include <string.h>

int main(void){

	char *string1="Sisi is the #1 mass murderer, world has ever seen till big bang.";
	char *string2="1234567";
	//strpbrk() returns a pointer so to show its value * must be used
	printf("\nOf the characters in %s\n%c appears first in \n%s", string2, *strpbrk(string1, string2), string1);

	getch();

}