I have this which does not compile with the error "fatal error C1017: invalid integer constant expression" from visual studio. How would I do this?
template <class B>
A *Create()
{
#if sizeof(B) > sizeof(A)
#error sizeof(B) > sizeof(A)!
#endif
...
}
...
I'm a C# .NET developer.
I need to learn C for embedded systems. Quickly.
Where do I start?
...
If compiling and linking with MinGW gcc v3 is painfully slow, and gcc v4 is not the default install option: What, for a beginner are the advantages/disadvantages of installing one version or another?
Say for example with gcc v4, I want to use PDCurses or other GNU libraries will I first have to recompile these from source?
I'm only a...
Hi everyone,
Could someone please help me with byte ordering regarding floating point variables? Actually the code is working correctly on Solaris, but not on Windows Xp. Here is a piece example of my code:
....
int x_snd=1;
float y_snd=1.13;
struct {
int xx_snd;
float yy_snd;
} data_snd;
int x_rec;
float y_rec;
...
I am trying to compile a c program that includes a header in to .c files.
but only 1 of the .c files is really using the defined variable in the header file.
here is some sample code that will generate the linker problem.
I am trying to have my header file contain global variables that are used by 2
different .c files... Any kind of ...
I have a basic question on array and pointer in C/C++.
Say I have:
Foo* fooPtrArray[4];
How to pass the fooPtrArray into a function?
I have tried:
int getResult(Foo** fooPtrArray){} // failed
int getResult(Foo* fooPtrArray[]){} // failed
How can I deal with pointer array?
EDIT: I once thought the error msg is from passing the...
I am just interested how sleep(time in ms) is implemented in C lib or basically at the os level..
I am guessing ..
1) may be the based on the processor speed you do a while loop of nop's ( not sure if the sleep time will be accurate)..
2) any special register in processor , where u write some value and the processor simply halts for sp...
Greetings!
Finally stared learning C and I think the time has come to start working with a debugger. At this time I'm using Gvim for editor and command line for compiling. After trying few debuggers ( KDbg, ddd,insight ) running gdb seems to be the simplest and least overwhelming at the moment.
I'm I on the right path or is there a bet...
Very stuck on this problem. I FINALLY got the average to come out, but it gives it as negative 32 million or something. Here is my code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
float fArray[30];
int choice = 0;
int x = 0;
float total = 0;
float avg = 0;
printf("1. Calculate GPA Average");
printf("\n2. Enter GPA");
pri...
Is there anyway to see what you code looks like after the preprocessor has done all the substitutions?
...
I'm trying to integrate an existing library into my project. But I keep getting this "Redefinition typedef error" when I try to compile. Here's the code that's part of the library.
Code:
typedef struct _tagAbc Abc;
typedef void *Apple (Abc* Orange);
typedef struct _tagAbc
{
Apple red;
}
Abc;
It seems that the compiler doesn't l...
C/C++ h264 or ON VP6 open source video encoder with capability of turning bmp's/png's or jpegs into video frames
What do I need
Open Source Libs for encoding.
Tutorials and blog articles on How to do it, about etc.
PS It should be SMALL SIZE!) (Not a mountain like FFMPEG)
...
Does the POSIX standard or another C standard provide a way to recover a meaningful message from a signal number, in the same way that strerror() makes it possible to recover a message from errno? The Gnu C library has strsignal(), but if possible, I would like something portable to BSD and other Unix variants.
...
Hi,
I get this error:
transform.c:23: warning: ‘struct user_data_s’ declared inside parameter list
transform.c:23: warning: its scope is only this definition or declaration, which is probably not what you want
Which I think is because I have a struct that contains a struct.
This is what I am trying to do:
void f2(struct user_data_s...
Hi, I'm trying to write a function that accepts a variable number of parameters like printf, does some stuff, then passes the variable list to printf. I'm not sure how to do this, because it seems like it would have to push them onto the stack.
Something approximately like this
http://pastie.org/694844
#include <stdio.h>
#include <st...
This is what I think the ++ operator does
a++; // a+=1 after calculating this line
++a; // a+=1 before calcuating this line
I'm trying to study pointers, and I think that I misunderstood something.
int a=10;
int arr[3]={0,1,2};
int *ptr;
ptr=arr;
printf("%d,%d,%d,%d\n",a++,a++,++a,++a);
printf("%d,%d,%d\n", ptr[0],ptr[1],ptr[2]);
p...
i have to prepare for an interview in C++ technology.
could you please drop in your suggestions and recommendations about how to start and what are the basic topics that i have to concentrate mostly on?
i have a prior knowledge on the topics but i am confused with what to concentrate on as C++/C are very vast.also i think that i have to ...
Hi,
I know what does dup or dup2 do ,but I have no idea when it would be used. Any practical examples? Thanks.
...
Hi,
I am looking for a lightweight open source paging B+ tree implementation that uses a disk file for storing the tree.
So far I have found only memory-based implementations, or something that has dependency on QT (?!) and does not even compile.
Modern C++ is preferred, but C will do too.
I prefer to avoid full embeddable DBMS solut...
I am compiling a program which creates window on shell. When I compile I get errors like
test.c:(.text+0x25): undefined reference to `newwin'
test.c:(.text+0x73): undefined reference to `wborder'
test.c:(.text+0xb6): undefined reference to `mvwprintw'
..
..
One of my functions is
WINDOW *f_top, *f_bottom;
WINDOW *create_window(int n...