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.
302 questions
0
votes
0
answers
79
views
Force ffmpeg to select libfdk_aac instead of native aac decoder via C API
I have an audio decoding application written using ffmpeg's C api. This decodes compressed audio and converts them to unsigned 32 bit PCM data. I have libfdk_aac linked to ffmpeg, and ffmpeg is ...
0
votes
0
answers
68
views
How do I reserve virtual memory, only (de)allocating physical memory on demand
I would like a large contiguous buffer, possibly larger than available RAM ('contiguous' in userspace virtual memory, not physical memory). As only parts of the buffer will be used, I would like to ...
2
votes
1
answer
817
views
How Wireshark is able to pick network traffic from within Windows10 coming from WSL2
My task is to create 2x programs written in C/C++ which can communicate with each other from within WSL2 and Windows 10. I'm able to send traffic from WSL2 to Windows 10, however
I cannot manage to ...
0
votes
0
answers
24
views
C-function fwrite in 'r+'-mode on Samba share
Since the switch from samba protocol SMB1 to SMB2, it seems that fwrite can't act in "r+"-mode on files on a mounted samba share anymore. Errno is set to EOPNOTSUPP (Operation not supported)....
0
votes
1
answer
198
views
How do browsers based on Chromium import passwords from Chrome?
How do browsers based on chromium import passwords from Chrome?
Browsers like Vivaldi Brave, Edge, Opera, etc… all have feature to import passwords from Chrome, and some even have ability to import ...
2
votes
2
answers
4k
views
Formatting of braces for C++ in Visual Studio Code
I've C/C++ extension of Microsoft as my default formatter. When I save/run my code the opening curly braces automatically move to newline instead of staying in sameline. How can I prevent this? (It ...
2
votes
1
answer
3k
views
How to get disk model and serial number for the disk Windows is installed on
You can use wmic diskdrive get model,serialnumber to get the model and the serial number of the disks currently plugged in, which are unique if you use both of them (if you use only serial number, ...
0
votes
1
answer
598
views
Detect if device is accessed using VNC [closed]
I like to check if our application on remote host is being accessed via VNC Viewer or other similar product of VNC. There are security preferences in our application which should restrict access to ...
0
votes
0
answers
2k
views
Visual Studio Code not running code in terminal
I'm trying to run my C code, but I keep getting this message in the terminal instead of the output I want.
I think it has something to do with installing MinGW incorrectly (or putting the wrong route ...
2
votes
1
answer
669
views
wxWidgets installation lacks setup.h file. Why?
I've just upgraded my machine to OpenSuSE Leap 15.5. In order to install a Python-based app named DisplayCAL, I need to setup the recent version of Python, wxWidgets, and the wxPython bindings. Python ...
0
votes
1
answer
341
views
How to solve `fileName::stripInvalid() called for invalid fileName CalibreLibrary` in OpenFOAM?
I installed OpenFOAM on my Linux Mint. When I run simpleFoam, the following prompt appears:
~ ❯❯❯ simpleFoam
/*---------------------------------------------------------------------------*\
========= ...
1
vote
1
answer
2k
views
VScode not showing errors in real time
Is there any way to set VScode in a way that it shows errors in real time? So far I can only see them after compiling.
I'm running VScode with WSL and I have C/C++ themes installed.
I already made ...
1
vote
0
answers
1k
views
C/C++ compiler from command line
I want to install GCC or another C/C++ compiler entirely from the command line in Windows. I've looked at Winget and and Chocolaty but I've only found GNU ARM products.
How do I install a C/C++ ...
0
votes
1
answer
165
views
What is the purpose of lex and yacc?
I'm currently trying to develop a compiler of my own using the C language. I came across this thread that says that learning lex and yacc will help in building compilers. However, I don't understand ...
1
vote
0
answers
50
views
What C calls does mdls use? [closed]
I am hoping to get mdls information from C calls, as I am using a different programme's FFI to make C calls. (In particular, I am after the kMDItemContentTypeTree key.) I have tried using getxattr, ...
3
votes
1
answer
6k
views
Is it possible to scan for Bluetooth devices without the bluetoothd daemon running?
I am working on an embedded system and I need to scan for Bluetooth devices. I want to do this with my own program, which I can do using the hci_get_route() and supporting hci functions from the BlueZ ...
0
votes
2
answers
379
views
In Windows cmd, does grep use GetCommandLine(), and findstr use argv?
In Windows cmd, does grep use GetCommandLine(), and findstr use argv?
This is the grep i'm using
C:\>where grep
c:\cygwin\bin\grep.exe
C:\>c:\cygwin\bin\grep.exe --version
grep (GNU grep) 3.7
...
0
votes
1
answer
25
views
Bash command to see which types of operations in c program take most time
This is probably an easy one and I was googling for a long time, but can not find it.
I have written a small C program. It compiles and runs without any problems. But I want to see if there is ...
1
vote
2
answers
3k
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?
0
votes
0
answers
470
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 ...
0
votes
1
answer
385
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(&...
2
votes
1
answer
615
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 '(...
0
votes
1
answer
876
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 ...
0
votes
1
answer
249
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. ...
0
votes
0
answers
186
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 ...
1
vote
1
answer
1k
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 ...
0
votes
0
answers
426
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, ...
2
votes
1
answer
5k
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 ...
0
votes
0
answers
1k
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 ...
0
votes
3
answers
116
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 ...
0
votes
1
answer
344
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 ...
0
votes
0
answers
3k
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 ...
2
votes
1
answer
3k
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 ...
1
vote
0
answers
499
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 ...
1
vote
1
answer
171
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 ...
1
vote
2
answers
676
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:
...
0
votes
0
answers
981
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 ...
1
vote
0
answers
615
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 -...
0
votes
0
answers
108
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
1
vote
0
answers
75
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: ...
1
vote
0
answers
41
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 ...
2
votes
0
answers
52
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 ...
0
votes
1
answer
937
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 ...
1
vote
1
answer
260
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 ...
2
votes
0
answers
1k
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 ...
0
votes
1
answer
119
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 :
...
2
votes
0
answers
238
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 ...
0
votes
0
answers
48
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 ...
6
votes
1
answer
26k
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 ...
0
votes
1
answer
2k
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, ...