The question is pretty much in the title. The code void modify_str(char* str){ if(strlen(str) > 5) { str[5] = 'x'; } } Will invoke undef
FILE* inp; inp = fopen("wordlist.txt","r"); //filename of your data file char arr[100][5]; //max word length 5 int i = 0; while(1){ char r
NEC2 was originally written in Fortran and there have been two different ports to C from the original Fortran (xnec2c and necpp). The variable and function name
I'm trying to write a program that uses Caesar's algorithm to cipher a string input. I'm a beginner to C but I can understand basic codes. So to cipher the text
The following program checks if a signal is pending. I use the sigpending function to return blocked (or waiting) signals. The problem is that I don't want this
I'm new to C, and in order to practice I found a task on the Internet: Write C code that has functions that can: (1) Create a linear table; (2) Input data elem
I wrote the following code based of off Confusion about different clobber description for arm inline assembly and it works fine: #include <
I have the following code #include <stdio.h> //#define arraySize 5 #define arraySize 500 void func(double B[arraySize][arraySize]) { B[0][0] = 5; } i
While I practice C,I developed sample insertion sort in C. after some search and refer some materials ,I wrote following one. After that,I build and run. gcc in
#include <stdio.h> #include <stdlib.h> #include <string.h> struct charact { char ch; int occurs; struct charact *next; }; typedef
Let k be a positive integer. Is it possible to find out the value of 3^k in mod 1000000007? I have written a C program code to do this but it gives a message on
i want to read from the file using fgets and send the information to struct in array so i write this code but the output in incorrect this is the file i tried t
I have a string that I want to execute in C file and I'd like to get the string from standard input. echo "Here is some random text.\n" | ./ma
I have this assignment for college where i recieve the matrix A and i need to create the matrix B, where in each cell there whould be the neighbor's average of
In plain C, pointers to void are useful as arguments to generic functions, such as a generic quicksort, or a generic swap, etc., as seen here: Implementation of
I have read that converting a function pointer to a data pointer and vice versa works on most platforms but is not guaranteed to work. Why is this the case? Sho
I am building a Python wrapper for a C++ SDK in Python The app I am building on top of is using a console that is always listening to input on stdin Everything
I'm trying to understand what is behind this behaviour in my parent process. Basically, I create a child process and connect its stdout to my pipe. The parent p
I have this typedef and struct: typedef double mat[MAT_SIZE][MAT_SIZE]; typedef struct matList { char *name; mat *matrix; } matList; and I create an a
The venerable snprintf() function... int snprintf( char *restrict buffer, size_t bufsz, const char *restrict format, ... ); returns the number of characters it