Tagged Questions
0
votes
3answers
71 views
Review: Compare two Anagrams words in C
A simple attempt by me to test whether two words are anagrams or not. Here is the code:
#include <stdio.h>
#include <ctype.h>
#define CH_LEN 15
#define N 26
int main(void) {
char ...
2
votes
1answer
175 views
Arduino based SNES controller wireless transmitter/reciever, code questions
I am building a transmitter and reciever pair for two SNES controllers, as I don't like using long extension cords to get the controllers to reach the couch. I'm using atmega328p's for the avr's, ...
4
votes
3answers
236 views
C Split function review
I started learning C a week ago, and here is my implementation for the split function:
char** my_split(const char* str, char delim, int* size)
{
int index = 0, start;
char** results = NULL;
...
2
votes
5answers
144 views
Buy and Sell game project
it's a buy and sell game, and i revised it, it's still unfinished though, i would appreciate it if someone reviewed again for me.
#include<stdio.h>
#include<conio.h>
...
-3
votes
1answer
149 views
how can i improve/reduce this code? [closed]
any type of suggestion/correction will do, and i can't seem to get my functions to work or my conditional statements.
int buyitem(int x, int y)//* function used to buy an item at any store*//
{ ...
1
vote
4answers
303 views
Reading tokenized numbers from a file
int *getUserInput(FILE *fpin, int *elementCount) {
int *userInput;
// Load file into buffer
int length = fileLength(fpin);
char *buffer = (char *) malloc(length * sizeof(char));
int written ...
3
votes
2answers
98 views
Please review my function code for adherence to C standards and whatever else could be improved to it
I am relatively new to C and would like some feedback on a function that I have written, if it adheres to C standards or if there are some other things which I could have done better/differently.
The ...
4
votes
3answers
3k views
Min / Max function of 1D array in C / C++
Due to software constraints, I cannot use the standard libraries, math.h,algorithm, templates, inline, or boost. I am also using standard C (ISO C99) such that array is not a reserved keyword like it ...
4
votes
2answers
784 views
Function pointers and switch statements
I feel like I can make my switch statements more elegant with a function pointer, i.e. I'd like to set the digestLength and a pointer to a function in the same switch statement instead of setting the ...