I am using getifaddrs() and inet_ntop() to get the ip addresses on the system. When the system is set to IPv6 the address returned is in the shortened version (using :: for zeros). Is there any way to expand that address to a full one?
This is the code I am using:
struct ifaddrs *myaddrs, *ifa;
void *in_addr;
char buf[64];
if(getifadd...
I recently came across a good book by Richard Stevens, his "UNIX Network Programming, Volume 1, 2nd Edition" (in C), published 1998. I was reading it for the past week & realized while practicing some of the programs, that several methods used in it are not compliant to the standards or have a bit different approach. Also reproducing the...
I am having some trouble running this linked list implementation (containing words as data). Problem is when I try to print the words (that I inserted) in the Linked List,I get nothing. What am I doing wrong, breaking my head over this? I hope it's not something silly. Anyway here's the code -
typedef struct node
{
void *data;
s...
I am trying to compile ncurses-5.7 from source and after running ./configure I get the following error:
configure: error: Your compiler does not appear to recognize prototypes.
You have the following choices:
a. adjust your compiler options
b. get an up-to-date compiler
c. use a wrapper such as unproto
how can...
hi,
Is there any C compiler which takes the default type of char as unsigned unless explicitly mentioned by the user in the file or project settings?
/Kanu_
...
I'm writing a linux shell for my operating systems class. I've knocked out the majority of it but I'm stuck on simple string comparisons. I've everything I can think of. strcmp should take in \0 terminated strings and return 0 for equal but that doesn't seem to be working and even stepping through the array and checking each char isn'...
I have the following group of processes, which need to be closed programmatically by the first listed process, which is a C program that I am coding.
PID PGRP SESN PPID USER TTY CMD
6553 6553 6553 1 root ? ./startserv
6554 6553 6553 6553 root ? expect -- /usr/bin/unbuffer ./srcds_run...
6555 655...
When I continuously do "step into",it switches between different threads.
But how's that scheduled in visual studio,how does it know which thread to activate for next instruction?
...
Currently I have a UNIX executable that I am compiling from xcode. It runs in terminal. (osx) I'm wondering if there is a way to call functions / interact with a flash or flex project. I found some information about a flex c++ bridge, but apparently it is only for windows. Can this be done with air? Any suggestion?
...
Hi
I am recieving live audio as floating points in an updating array. I want this live data to present as a file that can b read by vlc media player. Can someone guide me how can I do that in C language?
/mudassar
...
Especially,how the thread be named by method name like GrabberCB::BufferCB?
...
As we know that we can use c functions directly in c++, when is extern "C" necessary then?
...
Is there a way to sort an array of strings in alphabetical order where the strings contain both capital and lowercase letters?
Because capital letters have a lower ASCII value so functions like strcmp would always show that it is before a lower case letter. For example, lets say we wanted to sort "ABCD", "ZZZZ", "turtle", "JAVA", "wate...
Hi folks,
I fall in some problem.
I need to write some function like memcpy(void*, const void*), which its signature should be:
void arrayCopy(void *dest, int dIndex, const void *src, int sIndex, int len)
I noticed that, in many implementation of memcpy, we cast void* to char*, but I think this is not the case of me, as the arrayCop...
Hi guyz,
The following program doesn't output desired data (on VC2008 compiler)
#include <stdio.h>
#include <string.h>
int main(void)
{
int i;
int dest[10] = {1};
int src [] = {2, 3, 4, 5, 6};
memcpy(dest, src, 5);
for (i=0; i<10; i++) printf("%i\n", dest[i]);
return 0;
}
whereas using char arrays instead, ...
I'm really new to C programming, although I have done quite a bit of other types of programming.
I was wondering if someone could explain to me why this program outputs 10.
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/wait.h>
#include <stdlib.h>
int value = 10;
int main()
{
pid_t pid;
pid = for...
I'm looking for a way to determine whether an ARM processor is booting from a cold boot (i.e. initial power-on) versus a warm boot (i.e. reset assertion without actual power loss). Specifically I'm using an ARM968 core, will be making the determination using C or assembly, and I will use the determination so certain operations only run ...
I need to hold an array of C strings. Now I know C strings are just an array of chars so essentially what I want is a 2d array of chars. The strings I'm trying to store will also never exceed 6 characters. My plan is to initialize a char array with 50 "string slots" and then if I hit 50 strings reallocate the array's memory to double it'...
How can I use C++ enum types like C# ?
consider following definition in c++ :
enum myEnum { A, B, C};
myEnum en = A;
Now I want write line #2 as following line like C# :
myEnum en = myEnum.A;
??
...
I want to know which is beneficial in terms of performance and execution time: calling C code from C# or converting C code into C# code.
Note: My C code uses Linear Algebra Library.
...