Questions tagged [c]

C is a general-purpose programming language used for system programming (OS and embedded), libraries, games and cross-platform. This tag should be used with general questions concerning the C language, as defined in the ISO 9899 standard (the latest version, 9899:2018, unless otherwise specified — also tag version-specific requests with c89, c99, c11, etc). C is distinct from C++ and it should not be combined with the C++ tag absent a rational reason.

Filter by
Sorted by
Tagged with
0
votes
0answers
18 views

Why static ds is faster than dynamic ds in terms of access time? [closed]

Data structures is how we systamatically organize the data. It is of two types Static ds Dynamic ds In terms of access time how static ds is faster than dynamic ds?
0
votes
0answers
13 views

Using a double pointer, how do you fill a 2D with Strings?

I am reading a text file line by line. Putting each line into a 2d array. Sometimes the program works, but usually the first element of the 2d array returns as gibberish, example: `W@??. I've looked ...
0
votes
0answers
13 views

Most often element in unordered vector in linear time (hash)

The program receives a list of n values ​​and prints the one most frequently (the entries end with zero). I used hashing for complexity to be linear. The program fails for an entry of type\ Intput: 10 ...
0
votes
1answer
11 views

Index of the element in array changes but value don't

could you please explain why the var ndx is changing every time, so do value (if use print function), but don't inside for loop, so every time I get the same value (2). And how can I fix that? int ...
0
votes
0answers
27 views

Why is nothing being printed to this file?

I am new to programming and C, and I'm trying to do one of my assignments for a couple weeks now without success. The objective is to create a file (seno.txt) with a bunch of random sines, read from ...
1
vote
2answers
25 views

Remove text from string after a certain repeated character

char str[] = "C:\Users\test\Desktop\folder\test.txt"; char *ptr; ptr = strchr(str, '\'); if (ptr != NULL) { *ptr = '\0'; } How do I remove the last ' \ ' including test.txt so it is ...
0
votes
1answer
29 views

C program to search through a linked list

#include<string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #define STATION_CODE_LENGTH 4 typedef struct _station { char code[STATION_CODE_LENGTH]; ...
1
vote
4answers
63 views

How to bit shift “x” with “y”?

I have some trouble with a bit-shift program. The challenge is to write a program which can shift an unsigned int a number of steps to the left. Both integers are given as input by the user. Thus, ...
0
votes
0answers
11 views

How to alias Doxygen automated links to a different symbol

I use Doxygen 1.8.14 for my C API. My API has some convention where an entity, let's say the Flower entity, is referenced to by an opaque pointer called Flower and a public structure called FlowerData....
0
votes
1answer
41 views

C nested structs with list

I created structer of 10 by 10 array for storing random number. Also made a list so each member will hold different 10 by 10. But when i print it, the numbers kind of broken, i dont know if my for ...
-1
votes
0answers
17 views

How to read command in Parent, execute in Child, return output through Parent?

For a school assignment we have to run certain commands in such a way that we read the command in the Parent Process, we execute it in the Child Process and we get the output through the parent ...
-1
votes
0answers
14 views

Xcode12 returns “use of undeclared identifier 'verify_noerr'” when trying to build project

I'm trying to compile this project in Xcode 12, Catalina (Mac 10.15): http://github.com/mattingalls/Soundflower/tree/master/SoundflowerBed Currently, the error I'm getting is "use of undeclared ...
0
votes
1answer
40 views

Problem with segmentation fault . Did I allocate memory wrong?

#include <stdio.h> #include <stdlib.h> void fa(int **m , int k){ int i; for(i=1;i<=k;i++){ free(m[i]); } free(m); } int check(int x , ...
0
votes
0answers
23 views

Avoid NUL Terminating Character for Stack Smashing with strpcy

I have recently been following aleph1's "Smashing The Stack For Fun And Profit" paper, and I've reached a part where I am unable to smash the stack with strcpy. (Reference: http://insecure....
-3
votes
0answers
35 views

Please i need someone to explain this code step by step [closed]

Hello all I'm new to c language programming can someone explain to me the below code, I know that it is a playfair encryption in c language. But I need step by step explanation of the code please, I'm ...

15 30 50 per page
1
2 3 4 5
22832