Questions tagged [c]

C is a general-purpose computer programming language used for operating systems, games and other high performance work and is clearly distinct from C++. Questions about programming in C are off topic and will be closed or migrated. Consider asking your question at Stack Overflow instead.

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

how to power motors correctly on raspberry pi pico [migrated]

I was using my raspberry pi pico and testing motors, and it worked just fine(pins was in GND + 3v3 pins). Then I wanted to use On/Off function in C, And i used the pin GP28_A2 to use it. But it wont ...
user avatar
0 votes
0 answers
22 views

How to allow my C Server access from outside localhost

I'm trying to run an UDP Client-Server message exchange program for a university course, when I try it in a local network even with different PCs works really fine. But the moment I try to run it on ...
user avatar
1 vote
2 answers
70 views

Can you run an exe file made with linux on windows

I compiled a c file on my linux machine and named it test.exe, is it possible to run that file on windows?
user avatar
  • 13
0 votes
0 answers
29 views

Bash processes with deleted link targets in /proc/<pid>/exe

We have a software which intercepts file IO operations and noticed a recent bug caused by a process who's /proc/$pid/exe pointed to /usr/bin/bash;61f1808a (deleted) (via readlink(2)). I'm curious what ...
user avatar
0 votes
1 answer
35 views

How to kill this C program running inside tmux?

I'm testing a C program which has a section like this: #include <iostream> #include <unistd.h> #define LOOP_MAX 100 int main() { for (int i = 0; i < LOOP_MAX; i++) { printf(&...
user avatar
  • 157
0 votes
1 answer
37 views

calculating memory used by "ext4_inode_cache" from /proc/slabinfo?

On Linux I have two ways to get the memory used by ext4_inode_cache. First is using the slabtop command which gives me "CACHE SIZE" information too: # slabtop -o -s c | grep -E '(...
user avatar
  • 43
0 votes
1 answer
23 views

calculating total CPU use in percentage

So I am working in C and I am considering opening the proc/cpuinfo file and just extracting the data. (Honestly not even sure how to do that.) But I am not sure how to calculate it. Is it just CPU MHz ...
user avatar
0 votes
1 answer
23 views

Accessing notepad++ from cygwin bash

So when I am writing code, I use notepad++ and when I am done, I copy-paste it to plain old notepad because I use Cygwin and notepad is the only text editor that I know how to access from the shell. ...
user avatar
0 votes
0 answers
13 views

Is there a way in OpenVPN to change the VPN server ip or location and this can be done on my system using OPENVPN

So I am in need to some info about openVPN that allows to change VPN server Ip or location. The idea basically is if there is a way to change VPN server location and restart openVPN in my system so ...
user avatar
  • 123
0 votes
0 answers
41 views

What is the concrete difference between a binary file and any other kind of text file? [duplicate]

Question based out of curiosity. Why if I copy the code from a binary compiled from c code, and paste it into a new file that I make executable, this new file doesn't act as a binary and execute the ...
user avatar
  • 101
0 votes
0 answers
24 views

Get usb device serial number in Windows [duplicate]

I've been working on an application in Linux to retrieve the usb serial number using C. In Linux I can read the file serial in /sys/bus/usb/devices/someusbdevice/ and this file will tell me the serial ...
user avatar
0 votes
0 answers
15 views

Netbeans 8.2 will not install

I got a new lab in one of my classes that was in a new language which was C. After going through a troublesome downloading process for minGW, so that my Netbeans could compile C code. My Netbeans ...
user avatar
0 votes
1 answer
68 views

Is there a way to annotate that a PR depends on another PR

If I create a Pull Request from a branch git checkout -b branch-for-first-PR # edits and commits git push origin branch-for-first-PR do some work in it, and then want to experiment with building on ...
user avatar
0 votes
0 answers
72 views

Windows: How to convert binary database file (compressed with zlib) to human-readable string data? (ProcrastiTracker .PT file)

The current question is derived directly from this one, as my general problem is how to process the data collected by the ProcrastiTracker program. Once installed on a Windows machine, ...
user avatar
  • 101
2 votes
1 answer
829 views

openssl's d2i_X509 complains with "wrong tag"

Tried to parse a DER key from a minecraft server auth protocol. openssl asn1parse -inform DER correctly parses the key, but when I try to use d2i_X509 function from within C to parse this data, I ...
user avatar
  • 123
0 votes
0 answers
486 views

iptables use to ignore TCP packets. Not reject But ignoring including syc comning in but nothing is done

I like to simulate TCP connection in Server-client using layer 2 sockets for receiving packets and sending packets using Packet MMAP or DPDK or netfilters and dev_xmit for this to come any close to ...
user avatar
  • 123
0 votes
3 answers
55 views

how to read and edit a file with .work extension

I have been using Pollard's kangaroo for SECPK1 and I'm wondering on how to edit the files with .work extension. I googled it and it said I can use Bibble 5 or Coral AfterShot Pro but I cannot open it ...
user avatar
0 votes
1 answer
567 views

is it possible to run the nnn File Manager on Windows?

edited: using powershell I installed what I thought was nnn (https://github.com/jarun/nnn): PS> python.exe -m pip install nnn how do I run it? does it run on PowerShell or cmd? update: the nnn ...
user avatar
  • 244
0 votes
1 answer
114 views

How to delete a file with 0 bytes, but read "þa" from it in a c program

This question is not the same as How to delete an invincible 0 byte file? since none of the answers have worked and my impossible to delete file I "feeeel" is different. I was following this ...
user avatar
  • 103
0 votes
0 answers
558 views

How do you stop McAfee from quarantining your .EXE?

I have a history with McAfee quarantining my C code in Microsoft Visual Studio and others have had the same problem. There are solutions, but that requires every .EXE in all your solutions to be ...
user avatar
2 votes
1 answer
529 views

Net User information VS Get-ADUser

Very generic question regarding different output for Net User, and Get-ADUser. What is really going on "under the hood" when I run each command? I bring this up only due to getting different ...
user avatar
1 vote
0 answers
114 views

Input Queue Tracing with ETW Microsoft-Windows-Win32k

I have UI lags when the machine is busy. When I click on different windows on my UI the selection is not changing which indicates a blocked message queue. After some time 20s or longer the click ...
user avatar
1 vote
1 answer
63 views

How can I send CR (i.e. ascii 13) to a c program from keyboard (running linux)? ALSO, why do I have to send EOF twice to terminate this program?

I have read that Ctrl-J sends '\n', Ctrl-M sends '\r' and Ctrl-D sends EOF, but either this is incorrect or I'm simply not understanding what's happening. This simple program illustrates: const ...
user avatar
  • 13
1 vote
2 answers
76 views

Wait for process to start on linux/(net)bsd

I'm attempting to make a script which tracks how many times you execute a specific process. I want to detect when the process starts and then log it. The psuedo-code would be something like this: ...
user avatar
0 votes
0 answers
324 views

Intel compilers fail when math.h is included

I have a very small test C program, in a file called test.c: #include <math.h> int main() { return 0; } If I try to compile this using icc test.c, I get the following errors, that seem to ...
user avatar
1 vote
0 answers
395 views

libXext.so.6: error adding symbols: DSO missing from command line

i am trying to compile FreeRDP i have this cmake commands cmake -DMONOLITHIC_BUILD=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release \ -DWITH_SSE2=OFF -DWITH_ALSA=OFF -DWITH_FFMPEG=OFF -...
user avatar
0 votes
0 answers
35 views

Is dd command in linux faster than single character reading functions

I need to extract some content of different length at different offset from a file. I would like to know whether to use dd command or simple character reading functions like fgetc
user avatar
  • 133
1 vote
0 answers
43 views

final link failed ssh

make task_1 gcc -std=c11 -Wall -Werror task_1.c -lsuperkarel -lcurses -o task_1 /usr/bin/ld: final link failed: Disk quota exceeded collect2: error: ld returned 1 exit status make: *** [Makefile:9: ...
user avatar
1 vote
0 answers
22 views

Audio not playing in an application with setreuid() & setgid(), but works with sudo -u command

I have a Arch Linux system with alsa and pulseaudio configured. alsa is set to use pulseaudio default device. Pulseaudio is rumming with tcp module enabled on 127.0.0.1 and anonymous set to true. The ...
user avatar
  • 131
2 votes
0 answers
43 views

Best way to launch a linux/unix command from C Language

After doing some research i came here, just wanted to know what is the better way to launch a command(for both input/out controlled & not controlled scenarios) in C language. I have looked at the ...
user avatar
  • 133
0 votes
1 answer
308 views

Far Manager - *.cpp file association

I've been trying to get started with Far Manager, but there are not many good resources out there for setting it up as an ide. Specifically, I'm trying to create a *.cpp file association so I can ...
user avatar
1 vote
1 answer
100 views

Ubuntu v19.10- Tracker is not working

In MAC there is concept of spotlight which is used for indexing. In linux, gnome file manager is used tracker for file searching and tracker is used for file indexing. When I have searched for a file ...
user avatar
  • 13
1 vote
0 answers
324 views

Which one is correct? Average CPU usage in resource monitor or CPU usage in task manager?

I have a C program which I'm running in windows 10 and I need to know how much CPU it uses. When I run the program, the windows 10 task manager says the program is consuming 25% of the CPU. Although ...
user avatar
  • 111
0 votes
1 answer
49 views

How are files data separated in the hard drive?

if i only have a file that contain 1 byte and another file_2 that contain 1 bytes in my hard drive , how are they separated is there a character that separate them like NULL for example like : ...
user avatar
2 votes
0 answers
96 views

Perf top reports symbol "__cpuidle_text_start" consuming 87% CPU time

I have powersave (C-states) disabled in BIOS and in the kernel config, however, CONFIG_CPU_IDLE is enabled, and related "__cpuidle_text_start" takes too much CPU time, while I am not really sure what ...
user avatar
  • 41
0 votes
0 answers
41 views

How to add feature “don't copy when pressing command” in this c program—macPaste?

https://github.com/lodestone/macpaste https://github.com/lodestone/macpaste/blob/master/macpaste.c With this little project, I can copy a text to clipboard with just select a text, in macOS. This ...
user avatar
1 vote
1 answer
10k views

Systemd: "Session closed for user root"

I've written a C application that I would like run at boot. The software operation includes GPIO manipulation and an attached projection cape on the Beaglebone Black that I'm using. I ended up ...
user avatar
  • 73
0 votes
1 answer
318 views

which partition should be set active in windows 10?

I accidentally made C: as active, but don't know which one was before. Should I set the System Reserved as active? System Reserved - (System, Primary Partition) Win-10 (C:) - (Boot, Page File, ...
user avatar
  • 1
0 votes
2 answers
254 views

Can we store a whole string with the help of a single character pointer? If yes , How? [closed]

Here p is a character pointer not an array! Yet compiler gave no warning or error? char *p = "Vladimir";
user avatar
1 vote
1 answer
1k views

ALE not working despite passing correct flags to the enabled linters

I'm using VIM to program in C11. I'm trying to setup ALE but it seems that the linters can't find the headers, despite the correct flags are passed, such as -I /path/to/include. I'm using CMake, so ...
user avatar
0 votes
2 answers
19k views

gcc: fatal error: no input files

I wrote this simple line of code and saved it in a file called 'ex.c'. The code is the following (first line is purposely written wrong as it showed up different in the post): "#include < stdio.h &...
user avatar
  • 1
1 vote
2 answers
32k views

Visual Studio Code doesn't run code

Why VS Code doesn't want to run code when I use scanf() function to get user's input knowing that without this function the code runs perfectly.
user avatar
13 votes
1 answer
4k views

How does the OS tell whether an "Address is already in use"?

If my C program uses sockets, binds to localhost:9025, exchanges some data, gets manually killed and restarted, it sometimes crashes with the error being: Address already in use. All SE-...
user avatar
0 votes
2 answers
3k views

Access Denied when compiling c code with gcc

I compiled my c program with gcc -c -o test.exe test.c and it compiled with no errors and then when I run it gives Access is denied. This is my code #include <stdio.h> int main() { printf("...
user avatar
0 votes
1 answer
2k views

How to troubleshoot C / C++ not producing output in VS code?

I just followed the set up for C / C++ in VS code ( https://code.visualstudio.com/docs/cpp/config-mingw ), I found two strange things: In the "tasks.json" the code has this "command": "g++" which is ...
user avatar
0 votes
0 answers
24 views

Is it possible to pack C develop environment to single file?

Is it able to pack components of least C compile environment (compiler, linker, header file, libc and so on) to single executable file? Also How do I do it? I would like to make a portable C compile ...
user avatar
-1 votes
1 answer
27 views

include statement uses in C/C++ IDE

What determines when a file needs to be copied into a c/c++ project, instead of just using a #include statement? And if the IDE has project options that let the user list directories to include, how ...
user avatar
0 votes
1 answer
361 views

Version: 1.4.5 ./a.out: symbol lookup error: /usr/local/lib/libcjson.so.1: undefined symbol: floor

I've an error related to cJSON. I make and compile Ultralightweight_cJSON in Ubuntu 18. cJSON working fine but just little issue happen. When I use cJSON_AddNumberToObject(fmt, "width", 1920); ...
user avatar
  • 3
0 votes
2 answers
2k views

How to add graphics.h header file in gcc compiler?

I want to print a pixel on the screen using C language. When I write code and compile it shows graphics.h:No such file or directory I found that gcc doesn't have the "graphics.h" header file. How ...
user avatar
2 votes
0 answers
217 views

GDB suspended every time after run program

I try to debug my program using gdb, but gdb suspended every time after run program. $ > gdb -q ./main Reading symbols from ./main... (gdb) disas main Dump of assembler code for function main: ...
user avatar

1
2 3 4 5 6