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.

learn more… | top users | synonyms

-2
votes
0answers
14 views

Analysis of a “technique” for swapping 2 variables without a third temp variable [migrated]

I have come across a "technique" for swapping 2 variables (ints, chars or pointers) without third temp variable (ints, chars or pointers) , like this : int a = Something ; int b = SomethingElse ; ...
-1
votes
0answers
11 views

Removing dashes from SSN in a text file [closed]

I need to remove dashes from Social Security numbers in text files. There are hundreds of files in each folder. Can anyone help me with this?
0
votes
0answers
25 views

build numpy from source results in wrong architecture

I build numpy from source on my mac to link it to my ATLAS library. Thus, I wanted to run it as described here with these options: export MACOSX_DEPLOYMENT_TARGET=10.10 export CFLAGS="-arch i386 ...
-4
votes
3answers
49 views

Extract text from every three lines using Windows

I have a HUGE text file with details of my site users. (11GB+). It's built like that: Email: example@gmail.com Address: 1blahblahblahblah (Bitcoin Address). Password: blahblahblah Each of the ...
0
votes
0answers
11 views

Use _wfopen in C code without writing BOM [migrated]

Is it possible to not write out the BOM at the beginning of the file? as I want to later run the file in dos and it doesn't like that. e.g.script.bat > '' is not recognized as an internal ...
0
votes
1answer
34 views

BASH script that generates a header file with function prototypes

I am doing a C project which involves lots of static linking. To get rid of "implict function declaration" errors I will use a simple solution - a header file with function prototypes. I wrote this ...
0
votes
0answers
6 views

Code modification for an array of numbers to be read from pointer [migrated]

I have the following code: but "value" are many in numbers. I want to arrange all numbers along with max and min. if (value > stats_max) stats_max = value; if (value < stats_min) ...
0
votes
2answers
187 views

Need advice with making a customized linux distribution (From scratch or pre-existing distro?)

I'm working on an application on a bootable USB drive that runs at startup (doesn't give the user access to anything but this program). I figured I'd utilize an existing distribution, strip it of ...
0
votes
1answer
39 views

How to prevent GNU indent from breaking initialization assignment like “= { 0 };”

See following example. $ indent --version GNU indent 2.2.10 $ cat foo.c void foo() { struct { int a; int b; } v = { 0 }; } $ indent -st foo.c void foo () { struct { ...
0
votes
0answers
19 views

Reset BT adapter through software on linux

I'm trying to reset the Bluetooth adapters using HCI sockets (in C) /* Open HCI socket */ if ((ctl = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI)) < 0) { perror("Can't open HCI socket."); ...
2
votes
1answer
64 views

Does a better/newer C or C++ compiler produce more performant compiled code? Or do they just perform faster/better while compiling?

I am not a C or C++ programmer myself, but I often use software that needs to be compiled or otherwise depends on a compiler, like some R packages. Will that software actually perform better if I use ...
0
votes
2answers
59 views

Adding trec format tags to thousands of file

I need to add tags like text of file in thousand of files in a directory and I tried it using cat and outputing it to a stream of file using for file in * do cat ../gau > temp; //gau contain ...
0
votes
0answers
48 views

How can I use older gcc headers?

I installed gcc-3.4 to Debian 7.8 and create symbolic link /usr/bin/gcc. When I typed gcc --version I get: gcc (GCC) 3.4.6 (Debian 3.4.6.-9) Then I wrote simple C program. #include ...
-4
votes
1answer
36 views

I Accidentally Changed .C Files [closed]

I was trying to edit a .C file, but I accidentally chose to open it with Notepad. I am now having trouble finding the default program to open it with. I was wondering if any of you could help me find ...
0
votes
0answers
34 views

how to download and install outdated linux-headers

I just watched the issue concerning how to add additional driver (module) into pre-compiled kernel; I tried to install the linux-headers but in the current repository I could find that all the ...
0
votes
0answers
8 views

How can I know if SNMP Walk or a Table-View is started?

Hello how can I know if a User has "sent" a SNMP-Walk or a TABLE-VIEW request to a device with UCD-SNMP/NET-SNMP and custom coding?
0
votes
0answers
43 views

How to force only Chrome to send network traffic through selected IP interface (not system default) on Windows 7?

I have connected to multiple network interface (like LAN, WiFi, USB modem, VPN) and I want Chrome to use the DNS servers from selected network (BUT NOT SYSTEM DEFAULT means local network) and also ...
2
votes
4answers
874 views

What are these hex codes and how can they be decoded/encoded?

I have some interest if finding out a bit more about an exploit that was published that creates a root user in a linux machine; however, before I run the code, I want to make sure I understand all of ...
1
vote
2answers
60 views

Copying Unix Executable File content from file to file

I am simply experimenting but have found a phenomena that I would be very appreciative if someone could try to explain. I write a simple Hello World program in C. Use gcc to compile this program into ...
1
vote
3answers
2k views

How can I automatically lock the screen when idle in CentOS?

How can I automatically lock the screen when idle in CentOS? I would like it so that a user has to re-enter their password once the machine has been idle for a period of time. If there is no option ...
1
vote
3answers
97 views

How to keep the terminal open after executing a C program?

I'm trying to run a C program from within a python code. cmd = 'gnome-terminal --command=./myprog' subprocess.Popen(command, stdout=subprocess.PIPE, shell=True) The code executes and the terminal ...
1
vote
0answers
74 views

make a c program run without opening a cmd window [closed]

how can i make a c program run without opening a CMD window, i tried -mwindows flag, used WinMain Entry instead of main, but without results, the cmd still pop up. i tried ShowWindow function by ...
0
votes
1answer
102 views

How to change the default terminal beep frequency of the PC speaker?

I want to change the default sound frequency ofSND_BELL(which is used when\aor BEL or ^G is printed on the screen) to higher values (the current default is around 750Hz). Of course this turn to need a ...
0
votes
0answers
20 views

How to measure the latence time of each level of cache memory [closed]

I want to measure the size of each cache memory level (L1, L2, L3) and its latency time. I am using a C program that takes 3 parameters: the size of an arrays that will be read, the number of times to ...
0
votes
0answers
15 views

Can a subprocess launched from a parent executable access the memory of its parent?

Given a system() call with user controlled input, is it possible to read the virtual memory of the parent program? Assume that the system call is made with dropped privileges, and that running ...
-1
votes
2answers
354 views

Program built with MVS2012 “missing MSVCR120D.dll”

I started programming on Visual Studio Express 2012 instead of Code::Blocks, which is way more beautiful, but now I have a HUGE problem: My goal is to release a free OpenSource project with plenty of ...
-3
votes
1answer
73 views

“cannot open port!” in a DLL project [closed]

I made a C Console Application in Visual Studio in order to access one of the COM ports with the following code and all went well. #include <windows.h> #include <stdio.h> #include ...
0
votes
0answers
85 views

How to send COOKIE, PHPSESSID from my own webserver to php5-cgi script to execute PHP pages

I am developing a Webserver in C. I know how to pass environment variables to ph5-cgi, eg: putenv("QUERY_STRING="); putenv("REQUEST_METHOD=GET"); putenv("REDIRECT_STATUS=true"); ...
2
votes
1answer
6k views

Installing Cygwin C and C++ compilers for NetBeans IDE 7.2

I am very new to Cygwin, C, C++ and NetBeans IDE 7.2. My PC is running MICROSOFT WINDOWS 7 OS. I have read the documentation on how to install the Cygwin C C++ compilers. ...
-3
votes
1answer
37 views

i have three laptops with HD:500gb ,ram:4gb,OS:windows7 is it possible to form a cluster? If notwhy and How can I able to make use of cluster? [closed]

with HD:500gb , ram:4gb , OS:windows7 is it possible to form a cluster? If not why(i need more laptop or something) and How can I able to make use of cluster?
0
votes
1answer
73 views

Which GUI framework is used to make Ubuntu?

I'm interested to know, Which GUI framework is used to build ubuntu? As well i know it is built in C/C++. But what GUI is used to make Ubuntu? Help would be appreciated!
3
votes
2answers
2k views

How does one change the UUID of a Volume on Mac OS X to a SPECIFIED value?

This is similar to the question asked here: How does one change the UUID of a Volume on Mac OS X 10.6? Only difference is I want to change it to a specific value, not a random one. The hfs.util only ...
1
vote
1answer
31 views

How do I install programming info pages in Mac OS X?

I used to have a Linux system i was able to type info libc to view info pages on the C library, including unix functions. However, now I am running Mac OS X this does not work. How do I install the ...
0
votes
1answer
32 views

Linux C Compiler

I've just tried to install APCUPSD and have run into a missing C compiler error. I then ran yum install compat-gcc-34-g77 which went fine but the error did not go away, I tried which gcc as well ...
0
votes
1answer
124 views

Unable to compile GTK+ application

I'm trying to compile a simple GTK app for testing on a Trisquel 7 machine. The packages are derived from Ubuntu 14.04 LTS. I have libgtk2.0-dev installed, but when I try to compile, this is the ...
0
votes
2answers
5k views

username is not in the sudoers file. This incident will be reported

I am running ubuntu 12.04 on my laptop using VMware Player. I am not sure why but I have an account called "User Account" in addition to my account that I usually login to use ubuntu. Well that was ...
0
votes
1answer
120 views

How to delete a particular line in a text file after some operation on that text file at the same time

I am perl bginner (but i guess logic is same for all programming languages like C++ and C in my case its perl). What i want to achieve ? I have a text file i read that file which contains different ...
-1
votes
3answers
102 views

why 0(Zero) is treated as positive sign?

Can I know, In signed int or In Binary digit Zero is treated as positive sign and 1 is treated as negative sign. For example :- 1000 0000 0000 0110 = -6 0000 0000 0000 0110 = 6 But ...
2
votes
2answers
386 views

How to remove password of PDF with known password? [duplicate]

I have a personal PDF that I would like to remove the password for because the password was my old phone number (which I may forget). How can this be done? Maybe relevant that the PDF contains form ...
1
vote
1answer
1k views

How can I get the number of threads running in a process from /proc/[pid]/stat in Linux?

I have the pid of the process. I would like to know the current number of thread running in the process. I know I can read /proc/pid/stat for this information, but I'm not sure how to specifically get ...
2
votes
1answer
204 views

Geany comment block format

I'm trying to figure out where the comment block style is defined in Geany for C files. By this I mean when I select a block of text and hit ctrl-e, each line in the block of text is pre-pended (at ...
4
votes
2answers
5k views

NetBeans + MinGW + C - file not found

I have installed NetBeans 7.3 (twice this day), and installed MinGW (many times today). My OS Win 7 64 I tried to install MinGW with MSYS, tried MinGW with MSYS and MinGW DT, MinGW without MSYS, ...
1
vote
0answers
27 views

Access remotely two computers via IPv6 [closed]

I have a little problem on my house. Recently, I installed Teredo on two computers using sudo apt-get install miredo. Now I can access my two computer via IPv6 using Sockets in C. My goal is: I am a ...
0
votes
0answers
52 views

Link asm bootloader with c file

first of all I'm sorry if I put this post in a wrong category, but I'm new here... Recently I tried to make own, simple "OS". Maybe it's not an appropriate word for that, because my target was just ...
0
votes
1answer
597 views

How do I set up the NVIDIA nvcc toolchain in Netbeans 8.0 in windows 8.1

I found a plug-in for the nvcc toolchain but it only works on linux. What I want is to be able to compile CUDA C code on my windows computer from within Netbeans. ATM I'm using Netbeans 8 and MS ...
2
votes
1answer
41 views

Running native applications on the Linux Kernel

When the Linux kernel has loaded it loads the distro or OS to take over, how can I make the kernel load some native application (written in c) instead? I don't need a GUI or anything, Instead I want ...
0
votes
3answers
995 views

GCC won't work. problem with /usr/local/include

I was trying to add a new library/header and seem to have broken gcc. Specifically, I used the command: $ sudo cp mylib.h /usr/local/include This seems to have replaced the /usr/ directory with a ...
0
votes
1answer
46 views

How can I know whether a binary file is an executable or a library?

I have a binary file, but how can know the file type, lib or exe. By opening it with notepad++, it shows ELF and a lot of random symbols.
0
votes
1answer
388 views

Windows : How to protect process from getting killed in C/C++ [closed]

Is there any "GODLY" method through which i can protect my process from getting killed either from: 1>Task manager 2>Command prompt -- forcefully kill Things i tried : 1. Hooking Open Process and ...
-3
votes
1answer
130 views

How to create a local server to compile and run programs in C, Java,..etc [closed]

How can I create a local server on my Ubuntu laptop which is able to compile and run C, Java, Ruby, Python, etc code? And I want to use that service from my tablet through WiFi.