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
76 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 /*---------------------------------------------------------------------------*\ ========= ...
Milo's user avatar
  • 1
1 vote
0 answers
502 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 ...
c.leblanc's user avatar
  • 111
1 vote
0 answers
131 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++ ...
neo-code's user avatar
0 votes
0 answers
188 views

Organizing a Makefile with subdirectories

Scenario Makefile: all : a.out a.out : a.o b.o file tree: a.c b.c Makefile This a.c and b.c into object files, then links them to a.out Problem Suppose the file tree were to look like this: bin/a/a....
GooseDeveloper's user avatar
0 votes
1 answer
36 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 ...
Franz Zapanta's user avatar
0 votes
0 answers
308 views

Error while trying to debug c file on vs code

I'm trying to learn C and got this error after trying to debug my file: Unable to start debugging. Unexpected GDB output from command"-environment-cd path to my c folder". -environment-cd: ...
simelion's user avatar
1 vote
0 answers
37 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, ...
Jake Ireland's user avatar
3 votes
1 answer
2k 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 ...
Synthetix's user avatar
  • 237
0 votes
2 answers
202 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 ...
barlop's user avatar
  • 23.2k
0 votes
0 answers
39 views

Install python-shout in windows 11

I want to install python-shout in Windows 11. I have allready install in msys posix platform but i don't want it to msys2, i want to install in native Windows 11. I found that Mixxx program uses C/C++ ...
user726730's user avatar
0 votes
1 answer
21 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 ...
Michael's user avatar
  • 133
1 vote
2 answers
1k 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?
name's user avatar
  • 13
0 votes
0 answers
256 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 ...
ridderhoff's user avatar
0 votes
1 answer
233 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(&...
Niing's user avatar
  • 168
1 vote
1 answer
323 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 '(...
Sam's user avatar
  • 93
0 votes
1 answer
382 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
99 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. ...
Ahmad Alkhaled's user avatar
0 votes
0 answers
101 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 ...
awasi's user avatar
  • 101
1 vote
1 answer
538 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 ...
Mike Samuel's user avatar
0 votes
0 answers
184 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, ...
Emman's user avatar
  • 101
2 votes
1 answer
3k 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 ...
Maxxik CZ's user avatar
  • 123
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 ...
user786's user avatar
  • 133
0 votes
3 answers
73 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 ...
rage0920's user avatar
2 votes
1 answer
1k 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 ...
scjorge's user avatar
  • 264
0 votes
1 answer
239 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 ...
Luminous's user avatar
  • 103
0 votes
0 answers
1k 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 ...
Carson Fujita-Turnbull's user avatar
2 votes
1 answer
1k 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 ...
Abraham Zinala's user avatar
1 vote
0 answers
223 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 ...
Alois Kraus's user avatar
1 vote
1 answer
91 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 ...
joelk's user avatar
  • 13
1 vote
2 answers
279 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: ...
Skylar Bleed's user avatar
0 votes
0 answers
617 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 ...
sodiumnitrate's user avatar
1 vote
0 answers
490 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 -...
Dark.Attacker's user avatar
0 votes
0 answers
51 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
csavvy's user avatar
  • 133
1 vote
0 answers
61 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: ...
den taralevych's user avatar
1 vote
0 answers
26 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 ...
Anirban's user avatar
  • 131
2 votes
0 answers
47 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 ...
csavvy's user avatar
  • 133
0 votes
1 answer
535 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 ...
user1198172's user avatar
1 vote
1 answer
189 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 ...
Suyog's user avatar
  • 13
2 votes
0 answers
623 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 ...
MeiH's user avatar
  • 121
0 votes
1 answer
78 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 : ...
Oussema Nehdi's user avatar
2 votes
0 answers
168 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 ...
yy7k's user avatar
  • 41
0 votes
0 answers
43 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 ...
user956609's user avatar
5 votes
1 answer
18k 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 ...
Michael's user avatar
  • 143
0 votes
1 answer
787 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, ...
guest's user avatar
  • 1
0 votes
2 answers
264 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";
Da3kL10rd's user avatar
  • 137
1 vote
1 answer
2k 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
24k 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 &...
PCheck's user avatar
  • 1
2 votes
2 answers
60k 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.
Garde Des Ombres's 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-...
Captain Trojan's 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("...
Harry Kruger's user avatar

1
2 3 4 5 6