c

Basic Objective-C syntax: "%@"?

Hi, I'm working through the Stanford iPhone podcasts and have some basic questions. The first: why is there no easy string concatenation? (or am I just missing it?) I needed help with the NSLog below, and have no idea what it's currently doing (the %@ part). Do you just substitute those in wherever you need concatenation, and then comm...

Enter Password in C

I am aware that it is not possible to echo the * while you type in standard ANSI C. But is there a way to display nothing while someone is typing their password in the console. What I mean is like the sudo prompts in a Unix/Linux terminal. Like if you type in the command: sudo cp /etc/somefile ~/somedir. You are usually prompted for the ...

Looking for voice command code/library for obj-c/c

C/Obj-C Developers- I am looking for a way to listen for a specific word or small set of words to be spoken and fire an event. Needs to be able to run on the iPhone/iPad ... Looking for ideas? ...

Is there any Symbian Open-Source project for hosting some Flash SWF or pure HTML Site in it and easily compiling it into .sis?

So what I need is some Open-Source project for symbian which would consist of Customisable web browser and a folder to place my HTML+ images and SWF documents. So I don't have to dive deeply into Symbian Development and just put my files where I need, correct browser style menu and icons and compile into .sis So is there any thing like ...

GRAPH PROBLEM: find an algorithm to determine the shortest path from one point to another in a rectangular maze?

I'm getting such an headache trying to elaborate an appropriate algorithm to go from a START position to a EXIT position in a maze. For what is worth, the maze is rectangular, maxsize 500x500 and, in theory, is resolvable by DFS with some branch and bound techniques ... 10 3 4 7 6 3 3 1 2 2 1 0 2 2 2 4 2 2 5 2 2 1...

How can I use C to assign user input to a variable?

I am wondering if there is a function I could use in the standard libary. Do I need another library (BTW, I am developing for unix). ...

How to include clean target in makefile

I have a makefile that looks like this CXX = g++ -O2 -Wall all: code1 code2 code1: code1.cc utilities.cc $(CXX) $^ -o $@ code2: code2.cc utilities.cc $(CXX) $^ -o $@ What I want to do next is to include 'clean target' so that every time I run 'make' it will automatically delete the existing binary files of code1 and code2 bef...

bit ordering and endianess

I am reading a file byte-by-byte. Say for example i have this byte: 0x41 (0100 0001) represented in hex. Now, I want the first three bits of this byte, i.e (010). I can use bitwise logic to extract the first three bits, but my question is will the first three bits be independent of endianess of the machine.(i.e they can't be 001)? Th...

dynamic lib can't find static lib

env: gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9) app: Bin(main) calls dynamic lib(testb.so), and testb.so contains a static lib(libtesta.a). file list: main.c test.h a.c b.c then compile as: gcc -o testa.o -c a.c ar -r libtesta.a testa.o gcc -shared -fPIC -o testb.so b.c gcc -o main main.c -L. -ltesta -ldl then compile success, b...

How to set default name to GtkComboBox?

I want to set my GtkComboBox to have some default value/name, on it as follows: +---------------+---+ | Image Options | X | +---------------+---+ | Image Option 1 | +-------------------+ | Image Option 2 | +-------------------+ | Image Option 3 | +-------------------+ "Image Options" will be just a ...

Call a void* as a function without declaring a function pointer

I've searched but couldn't find any results (my terminology may be off) so forgive me if this has been asked before. I was wondering if there is an easy way to call a void* as a function in C without first declaring a function pointer and then assigning the function pointer the address; ie. assuming the function to be called is type vo...

How do you determine using stat() whether a file is a symbolic link?

I basically have to write a clone of the UNIX ls command for a class, and I've got almost everything working. One thing I can't seem to figure out how to do is check whether a file is a symbolic link or not. From the man page for stat(), I see that there is a mode_t value defined, S_IFLNK. This is how I'm trying to check whether a file ...

exiting from a blocking select call!

I am calling a third party API which creates a socket, does a connect and then calls select API by passing the socket to block forever. I don't have access to the socket. Is there some way in which I can make the select call come out from my application without having access to the socket? My platform is Windows. ...

linkning linux static libraries in windows with cygwin

I'm having a binary static library libfoo.a compiled for 32 bit linux machine. I wish to compile it against my win32 project compiled with cygwin. Is that possible? It seems to be possible, as all the object files in the archive should be in the standard ELF format. However I keep recieving linking errors about functions that nm finds ...

Question about compilers and how they work

This is the C code that frees memory of a singly linked list. It is compiled with Visual C++ 2008 and code works as it should be. /* Program done, so free allocated memory */ current = head; struct film * temp; temp = current; while (current != NULL) { temp = current->next; free(current); current = temp; } But I also encou...

Is there any C/C++ opensource library for Content Aware Image transformations?

I need it to have at least such features like Content Aware Fill, Content Aware Image Resizing. I need it as normal C/C++ library, usable from code, may be with dependencies on other open source libraris. But with examples of code compilable into stand alone applications! So is there any such library? Is there any C or C++ opensour...

Define integer ranges in C

Hi, I want to define a type named Int_1_100_Type which is an integer variable in the range from 1 to 100. How should i typedef this one? for eg: i am passing this variable to a function which accepts variable of type Int_1_100_Type. i.e funca(Int_1_100_Type Var1) Thanks Maddy ...

where does main() return its value?

I'm newly using CODE::BLOCKS+mingw compiler If I don't type return 0 at the end of program,I can see that main() is returning some integer,I learnt that main() returning 0 infers program executes successfully.I don't find any flaw in my code, why is it returning some integer? secondly any function returns its value to its function call,...

is there an equivalent of std::swap() in c

i know how to swap 2 variables in c++ . ie you use std::swap(a,b). question: does the c standard library have a similar function to c++ std::swap() or do i have to define it myself ...

A couple questions using fwrite/fread with data structures

Hi, I'm using fwrite() and fread() for the first time to write some data structures to disk and I have a couple of questions about best practices and proper ways of doing things. What I'm writing to disk (so I can later read it back) is all user profiles inserted in a Graph structure. Each graph vertex is of the following type: typede...