C is a general-purpose programming language

learn more… | top users | synonyms

0
votes
0answers
14 views

Is Vala a good choice for making a gui to a program? [on hold]

I've written a simpl program that manages environment variables where you can inspect your environment variables like printenv | sort | less. Now I want to make a GUI for my program. I tried Vala and ...
0
votes
0answers
14 views

conio.h header file giving an error during compiling C program in ubuntu [duplicate]

My code for a simple C program is #include<stdio.h> #include<conio.h> void main() { printf("This is demo program \n"); getch(); } when I am trying to run this c program. I am ...
-5
votes
1answer
27 views

Program in C to find matching numbers in an array [on hold]

I need the program to print match(2) if there are two matching numbers, match(3) for three matching numbers and if there is no matching numbers print "nothing". There are six numbers in the array and ...
4
votes
1answer
100 views
+150

How to log bash history by editing bash source?

I'm using bash-4.3.30. I need to log all my commands history on a single file. I can do that by editing the bashrc or bash_profile but I'm not going to do that. I want to play with bash source ...
4
votes
1answer
136 views

How to compile programs that use term.h?

I try to compile the code below: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <term.h> //#include "/usr/include/term.h" void clear_screen(void) { ...
-1
votes
1answer
35 views

Compiling error: expected ‘)’ before ‘&’ token [closed]

I'm trying to compile some code and I get an "error: expected ‘)’ before ‘&’ token" in this part of the code: int number_of_features; number_of_features = 400; CVAPI(void) ...
0
votes
0answers
12 views

Setting up environment for Nvidia OpenGL Samples with Netbeans

As title, I would like to set up the environment for the Nvidia OpenGL Samples with Netbeans. You can find the SDK here In Netbeans I tried to choose the first one.. I gave it the directory with ...
1
vote
1answer
29 views

Abnormal behaviour of malloc() fuction?

I was playing around with alloc functions in my Ubuntu 14.04 64-bit, gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) and found that malloc returns memory with initializing it to zero. Which is quite weird ...
0
votes
1answer
17 views

Install Ubuntu on Drive C Only

How do I install Ubuntu on Drive C only? I backed up all my data on Drive D and I'm afraid that I might lose them all.
1
vote
2answers
38 views

GCC Fatal Error

everyone Here's my problem; So, I'm new to Ubuntu and programming and I just wanted to start with C. I created the classic "hello.c" file #include <stdio.h> main () { printf("Hello ...
0
votes
1answer
29 views

Ubuntu Kernel Source Code for NAT Firewall [closed]

In TCP Communication, when the packet is being transferred from ethernet to network(IP) layer, I want to print the data present in that packet? I am working on linux (ununtu 14.04). I got some ...
-2
votes
0answers
26 views

linuxband installation [duplicate]

I'm trying to install linuxband. Unlike the question in Unable to install libjack-dev, I am able to install libjack-dev, i.e., I've installed all the requirements and dependencies listed here. The ...
1
vote
1answer
57 views

How to run C program on 14.04?

I'm trying to run some C programs using Geany and Code::Blocks. After coding them, when I run them, a message is showed in the terminal like this: In Code::Blocks: sh: 1: /home/c program files/2: ...
0
votes
0answers
28 views

how to install GLU files in ubuntu 14.04?

I am running Ubuntu 14.04. I am trying to execute a opengl code in C in but during compilation it is not accepting glu files but my code contains it. how should I include glu files during ...
2
votes
1answer
43 views

Can't compile tiny C code which uses librsvg

I am almost complete noob in linux world and I use Ubuntu 14.04 LTS with gnome-session-fallback (compiz) under VirtualBox on Windows 8.1 machine. My goal is to use this library: ...
0
votes
0answers
63 views

CODEBLOCKS - warning: GDB: Failed to set controlling terminal: Operation not permitted

I've installed Code::Blocks 13.12 in Ubuntu 14.04 through official repositories. When I compile, everything goes OK. But when I debug, the following message is shown at the sheel: warning: GDB: ...
0
votes
1answer
30 views

Problem with compiling C code in terminal

I've been having a problem with compiling. I used the following test C code below and saved it as test.c in Home folder. #include <stdio.h> int main() { printf("Bruh!"); return 0; } ...
2
votes
0answers
103 views

Undefined reference error while using custom system call in kernel 3.19

I'm trying to import new system call in the kernel 3.19. I've followed the tutorial given here! This is my simple code to implement factorial calculation via system call. #include ...
0
votes
0answers
8 views

Move/associate window from one group to another

I'm looking for a cross linux way to move a window from one group to another group. I thought of and tried this way but it didnt work, i share a screencast showing it doesnt work. In this screencast ...
0
votes
0answers
8 views

Dissociate window from .esktop file and chane icon with XChangeProperty

This is copy paste code that can be compiled with gcc -o icon icon.c -L/usr/X11/lib -lX11 -lstdc++. It opens a new window and sets its icon with XChangeProperty on _NET_WM_ICON. This proves it works ...
0
votes
0answers
34 views

Compiling an individual kernel module (Debian/Ubuntu)

I need to modify the ELF loader's kernel implementation of an Ubuntu 14.04 distribution. Having downloaded the sources using: sudo apt-get source linux-image-$(uname -r) I ran the configuration ...
0
votes
0answers
18 views

Menubar appears on different location using GLADE3 and GTK3.0

I have program develop using glade3 and GTK3.0 and C It is working well yesterday. However today the menubar ( " File Edit View Help " ) did not appear in my application window but goes to the very ...
2
votes
1answer
53 views

How do I handle a “No such file or directory” error for a header file from make?

When compiling a source package, I got an error from make that looked like: In file included from foo.c:28:0: bar.h:23:18: fatal error: bar.h: No such file or directory #include <bar.h> ...
0
votes
1answer
44 views

Geany no support greek language

I am using Geany for C programming. My code contains some greek sentences,I set the Default Encoding to GREEK(ISO-8859-7), but when I try to execute the program the greek letters show up like this. ...
0
votes
0answers
33 views

Communication between two PC via bluetooth

My problem is, that I try to get a connection between two PC with ubuntu. I'm programing in C/C++ and use the tuturial from Cubieboard. First step i did was the command: apt-get install bluez ...
4
votes
2answers
361 views

Python.h found by locate but not by GCC

I just wrote a simple C executable to check if Python.h is working or not #include<Python.h> #include<stdio.h> int main() { printf("this is a python header file included programm\n"); ...
0
votes
1answer
43 views

Any c functions to simulate double click on file?

I have some .desktop files and am looking for c functions that make it as if user double clicked on the .desktop files. Here are my desktop files: https://www.youtube.com/watch?v=Yc19BzLTnDE Thanks
0
votes
1answer
43 views

Connecting multiple serial ports

I am trying to communicate serially using bluetooth. I have tried to send a character serially to a program1.c program and it is reading it. I would like to use the same serial port /dev/rfcomm0 so ...
0
votes
0answers
17 views

Can i use “gksu” to became root for CLI operation?

I don't care if this is unsafe, because i'm only doing it as a programming exercise, but that's what i want to do: I want to create a C program that, with the "system" command, will call dpkg and ...
5
votes
2answers
171 views

C Using Libraries Without IDE [closed]

This may be a stupid question. How do you use C libraries without an IDE? I want to only use a text editor.
0
votes
0answers
33 views

mount ecryptfs with syscall in C language

I am trying to mount an fs with ecryptfs in a program in C. But I don't manage to give to the kernel part the key int mount_crypt(char* source) { int r = -1; char opt[1024] = ...
0
votes
1answer
33 views

Ubuntu: “X” mark on the top-right corner of respective file icons

I am new to ubuntu/ linux. Hence, please accept my apology for asking very trivial questions. Also, I googled; but, did not find suitable answer. I installed a third party lib: Taucs (location on my ...
0
votes
1answer
31 views

Where are the headers with IOCTL numbers for ext4?

I am looking for ext4.h, or another file that contains EXT4_IOC_*. There is nothing in /usr/include or /usr/src. I have linux-headers-generic installed. I am on Kubuntu 14.10. Where are the headers? ...
0
votes
1answer
178 views

fatal error: linux/err.h: No such file or directory [duplicate]

What package should install for this header (err.h) is available? I need this library (linux/err.h) to compile a proprietary driver (kernel module) in Ubuntu 14.04 Server/Desktop 64bits
1
vote
1answer
411 views

Lightweight C/C++ editor with code completion and debugging

Ever since the debugger plugin for geany stopped working (see below), I am looking for an editor for C/C++ source files with the following features: Code completion (i.e., Intellisense-like ...
0
votes
0answers
89 views

How to get paths for default theme icons folders?

I have a desktop file, for Icon i set it to myIconName. Now I have multiple sized PNGs for my icon. I need to find the paths to the default theme icon folders, cross-OS-Linux solution, so I can drop ...
0
votes
0answers
40 views

Fullscreen Detection Algorithm for lockscreen/screensaver

I'm working on a cross linux fullscreen detection algorithm, for use in detecting lock screen and screensaver. This is what I have so far: Check if _NET_WM_STATE_FULLSCREEN is supported, if it is ...
0
votes
1answer
190 views

Using mysql in C programming [closed]

I installed ubuntu on a virtual machine.There,I installed mysql server(sudo apt-get install mysql-server) .This worked, because I could acces mysql-u root -p password. After that,I did : sudo apt-get ...
0
votes
0answers
76 views

Creating SHA-512 password with function crypt

I want to create an encrypted password in a C program with the function crypt with the SHA-2 based hashing algorithms that are supposed to be included in the GNU C Library used by almost all Linux ...
2
votes
1answer
63 views

Gnuplot - Save result

I create a graph that changes each second using gnuplot.Now, I want to save this graph as gif or png file when my program finishes. How can I do? My C code is below FILE *pipe = popen("gnuplot ...
2
votes
1answer
63 views

GNU C - Signals never arrive to the handler

I'm working on a university project which needs to be written in GNU C and run on Ubuntu server. My primary OS at home is Ubuntu 14.04 on my PC. The project is about multi thread programming and I ...
0
votes
0answers
17 views

How to Terminate the Child process using ISR from parent process?

I wanted to create a C program to terminate a child process after specific time period (alarm()) using user defined ISR(Interrupt Service Routine) of parent process. How to do it?
0
votes
0answers
15 views

After my Disc partition, when i try to open my C: disc i get this message. Help please! [duplicate]

Error mounting /dev/sda4 at /media/santiago/7E460D8D460D46FD: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177" "/dev/sda4" ...
1
vote
1answer
67 views

How do I open C libraries and functions implementations?

I am having a problem that I cannot browse the header files /libraries to get the implementation of the C functions like mssget, msgsnd, shmat etc. How should I open these files?
0
votes
0answers
133 views

Header file for struct proc_dir_entry

I'm writing a firewall for the Linux kernel and I'm using the proc_dir_entry data structure (which I've found in the tutorial I'm currently reading). My firewall is conceived as a kernel module but ...
0
votes
1answer
34 views

Not able to include sqlite3 in c program

I installed libsqlite3-dev from ubuntu software center and after the installation, i found the sqlite3.h file in usr/include folder. There was no error in including that header file, but i am not able ...
-3
votes
1answer
203 views

C programming questions (newbie) [closed]

I read Kernighan & Ritchie C programming book now and have a few questions about 'getchar' and 'putchar'. The question is below the code example: #include <stdio.h> int main(void) { ...
0
votes
1answer
36 views

Which compiler i have to use to understand C behaviour exact behaviour

I am confused regarding with the c compilers. as per my knowledge for a programmer the code is not important but the internal behaviour is very important.cause if we know how the compiler behaves for ...
0
votes
0answers
233 views

Unable to create a directory on a mounted file system (FUSE). mkdir: cannot create directory `dirname': File exists

I was trying out the FUSE file system. I downloaded fuse 2.9.3 and installed it to a directory in my Home directory. I did rest of the work as superuser (as I was denied to manipulate the mounted ...
1
vote
2answers
2k views

No such file or directory #include <string> [closed]

I wrote the program kai.c and now am trying to compile it with gcc kai.c -o kai, which returns: kai.c:5:18: fatal error: string: No such file or directory #include <string> ^ ...