•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 363,781 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,549 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser:
•
•
•
•
•
•
•
•
How might I write an implementation in C of the standard library function strstr? Here's how I might. (View Snippet)
This is a program I created a couple of weeks ago for class using DevC++ compiler. THis program allows the user 20 tries to guess a number between 1 and 100. It keeps track of wins and losses and offfers the option to continue or quit, displaying game stats. (View Snippet)
This Program gives the details (name, kernel, machine type, domain, groups, sizeof data types, etc) of the host it is running on. (View Snippet)
This Program gives the UserDetails of the logged in User.
a) The RealName
b) Login Name ( Why do we need this?)
c) Home Directory
d) Default Login Shell
Additional Purpose of this code would be to invoke/ learn at man getpwuid and about struct passswd (View Snippet)
It's a simple program .Just enter any date in dd/mm/yyyy format.If you enter wrong you will get the message . (View Snippet)
Many times strtok is recommended for parsing a string; I don't care for strtok. Why?
It modifies the incoming string, so it cannot be used with string literals or other constant strings.
The identity of the delimiting character is lost.
It uses a static buffer while parsing, so it's not... (View Snippet)
Never use the function gets. Why? It is unsafe. Since the maximum string size cannot be specified, it is always susceptible to buffer overflow.
This snippet shows one way to do a safe version of gets. It reads characters from the stdin into a string up to the specified size and discards the... (View Snippet)
Obtaining user input can be done in many surprisingly different ways. This code is somewhere in the middle: safer than gets(text) or scanf("%s", text), but not bulletproof. It is meant to be a simple but relatively safe demonstration.
The function mygetline reads user input from the stdin into a... (View Snippet)
Hey People! This program gives you all Pythagorean triplets in a given range.( Eg. ( 3,4,5) - 3^2+4^2 = 5^2 ). I've used a pointer to allocate memory to hold the squares of all numbers in the range. The program uses a function to search for element in the array. (View Snippet)
This program prints the prime factors of a number. Eg. 56=2x2x2x7 .I've heard its really important and stuff.I believe it is really efficient and simple. Uses two functions : one to check if a number is prime and other to return the next prime number. (View Snippet)