I'm trying to initialize an unsigned long long int type. But the compiler is throwing an error
"error: integer constant is too large for "long" type ".
The initialization is shown below :
unsigned long long temp = 1298307964911120440;
Can anybody please let me know what the problem is and suggest a solution for the same.
...
I'm trying to decide which to learn and I've read all the "Which is better" questions/arguments, so I thought I'd get your take on something more specific.
Is there a platform dependency issue that C++ developers run into with such applications? Or, is it because there are more C developers out there than C++? I also noticed that many m...
Is there any way to compute length of va_list? All examples I seen the number of variable parameters is given explicitly.
...
Hello,
gcc 4.1.2 c99
I have the following enum's in this file ccsmd.h :
enum options_e
{
acm = 0,
anm,
smd,
OPTIONS_LAST_ENTRY,
OPTIONS_ENTRY_COUNT = OPTIONS_LAST_ENTRY
};
enum function_mode_e
{
play = 0,
record,
bridge,
MODE_LAST_ENTRY,
MODE_ENTRY_COUNT = MODE_LAST_ENTRY
};
error: redeclara...
Hi;
Suppose you have an fd set which can have zero or more sockets in it. When I try to call select operation on empty fd set, what I get is -1 as the number of fds which are set, meaning error. So what would you suggest to overcome this problem, you might say do not call if empty but I have a loop and any time fd set can hold 0 or more ...
Please see the code below:
#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
int main(void)
{
time_t current_time = 1270715952;
cout << "Subscriber current timestamp:" << current_time << endl;
tm* currentTm = localtime(¤t_time);
char tmp_str[256];
//2010-04-08T11:39:12
...
I've this weird behaviour in a multithreaded server programmed in C under GNU/Linux. While it's sending data, eventually will be interrupted by SIGPIPE. I managed to ignore signals in send() and treat errno after each action because of it.
So, it has two individual sending methods, one that sends a large amount of data at once (or at le...
Hi, I currently use C for numerical computations. I've heard that using C++ Expression Templates is better for scientific computing. What are C++ Expression Templates in simple terms?
Are there books around that discuss numerical methods/computations using C++ Expression Templates?
In what way, C++ Expression Templates are better than...
Hi there,
I've played a little bit with OpenAL, and I must say that it's pretty fast, even on the iPhone.
However, I still got one problem.
My app is recording the user voice, and repeats what he said using OpenAL.
I've modified the AL_PITCH value, but it's currently also changing the speed, which I don't want to !
Is there a simple way ...
I'm using WinVerifyTrust API in windows XP and I don't want any kind of user interaction. But when I set the WTD_UI_NONE attribute, although it doesn't show any dialog boxes, but it waits for a long time on the files that in fact wanted user interaction (I mean files which without mentioning the NO UI it will ask the user for that file)....
I'm asking because of the discussion that's been provoked in this thread.
Trying to have a serious back-and-forth discussion using comments under other people's replies is not easy or fun. So I'd like to hear what our C experts think without being restricted to 500 characters at a time.
The C standard has precious few words to say a...
i,
I have posted query previously and i am repeating same I want to modify igmpv3 (Linux)
which is inbuilt in kernel2.6.-- such that it reads a value from a file and appropriately decides reserved(res 1) value inside the igmpv3 paket which is sent by a host.
I want to add more to above question by saying that this is more a generic q...
I have some immutable data structures that I would like to manage using reference counts, sharing them across threads on an SMP system.
Here's what the release code looks like:
void avocado_release(struct avocado *p)
{
if (atomic_dec(p->refcount) == 0) {
free(p->pit);
free(p->juicy_innards);
free(p);
}
}...
Hello, I'm not quite sure if it's possible to do what I'm about to ask so I thought I'd ask.
I have a multi-threaded program where threads share a memory block to communicate necessary information. One of the information is termination of threads where threads constantly check for this value and when the value is changed, they know it's...
Hi everyone!
I am implementing, a distributed cache proxy server.I have an idea of the HTTP and related stuff, so i am rather concentrating on the sub part "Distributed data storage".
From some search on web i found that this could be done using Distributed Hash Tables(DHT).
I was wondering if there exists some kind of library for this...
hi,
I'm implementing some code generators, i would like to know if there's any way in C, if a variable has already been declared ?
I was trying to find something using the preprocessor but without any success...
thanks.
...
The prototype of memset is void *memset(void *s, int c, size_t n);. So why the third parameter is of type size_t ? memset is just an example, I want more general reasons. Thanks in advance.
...
Hi,
I wanted to store 10 in 4th position of array of 5 positions. How to do ?
int main( )
{
int a[5] = {,,,,4} ;
return 0;
}
If i do that i get error. Please help.
Thanks in advance.
...
In an assignment for college it was suggested to use the c readline function in an exercise. I have searched for its reference but still haven't found it. Does it really exist? In which header? Can you please post the link to the reference?
Thanks.
...
Hello everyone,
I've configured CEDET for emacs following Alex article (great!!).
Now, the questions:
1 - i've generated GTAGS with Gnu Global in my /usr/include, how can i check if semantic is using GTAGS?
2 - can I keep my GTAGS in another directory and instruct semantic to use that dir??
3 - In c/c++ sources, completion on inclu...