I need to push the .so(shared objects) of my application(wri tten in C) into the new MeeGo operating system.I have never done this porting before and have no clue where do i push them,which cross compilers reqd etc.
SDK i have found for MeeGo 1.1, but i guess that is for designing the application from the scratch?I am not sure..if somebody can give me any idea,that'll be really helpful.
Note:MeeGo is written in C++ it seems
...
User Profile
Collapse
-
Pushing shared objects into MeeGo
-
Ohk,let me put it this way,we say that the "heap grows". What exactly is meant by that?
**If, on doing malloc(), memory is taken from the heap then why do we say that the heap grows? -
Memory is added to the heap or taken from the heap?
We say that in a C process' memory layout,the heap segment deals with the dynamic memory allocation i.e. malloc,calloc.
When we do100000 bytes are :Code:int *p=malloc(100000);
1.taken from the system memory and whole 100000 bytes added into the process' heap memory segment
2.taken from the process' heap memory(process' heap already had this memory,it has turned accessible now )
3.taken from... -
I am attaching the whole code,please somebody run it yourself and tell me about this issue.
In function delete,*ptr=(*ptr)->nextis deleting the node successfully,co nfusing part is not the traversing or what i am doing,but what is happening at the address of the node to be deleted
...Code:#include<stdio.h> #include<stdlib.h> typedef struct node{ int value; struct node *next;Leave a comment:
-
I am retunrning temp back to main(),where i am holding this returned value in another node **ptr.,and then i am doing *ptr=(*ptr)->next;
Ok,i'll change the code a little bit,i am not returning temp any more.Now my delete function's protoype will be :this will also delete...Code:[B]void[/B] delete(int value) { .. ..same as before.. if(flag==1) { [B] *temp=(*temp)->next;[/B] } }Leave a comment:
-
I agree, what's happening in that line is similar to:
means exactly whats happening at *ptr=(*ptr)->next;Code:node *current current=current->next
But using single pointer to the node,if you would have done
current=current->next,it wont effect the link list at all,it will remain as it is,but using double pointer this line
*ptr=(*ptr)->next is actually deleting the node.
How it is traversing...Leave a comment:
-
Double pointers!
I have written a code of deleting a node from a link list using double pointers,i am not sure if i'll be able to explain what i want to ask..
so the code goes like this:
...Code:node **ptr=NULL; node **delete(int value) { int flag=0; node **temp=&root; while(*temp!=NULL) { if((*temp)->value==value) { flag =1; break; } else { -
name of the array decays to pointer..
The name of the array decays to pointer except 2 at 2 cases(sizeof and & operator).Code:char *p="Hello"; char q[]="Hello"; p++; q++;// THIS LINE GIVES ERROR,LValue reqd as increment operand printf("%s %s\n",p,q);
So when q in the above example decays to pointer,why it is giving error in q++ whereas p++ is doing fine.? -
Function Pointers
Is'nt it necessary that a function pointer's protoype must be absolutely same as the function for which it is intended?
eg:
This works fine!It does'nt matter whether or not i am passing any arguments?how the arguments are resolved...Code:typedef void (*func)(); void someFunc(int i,int j) {printf("%d %d",i,j);} void main() { func temp=someFunc; temp(2,3); } -
#define is a macro,a preprocessor directive,its simply a textual replacement,so wherever you have written PI in your code will be replaced to 3.1416 before the compiler comes into the picture.
Whereas in the other case you are a declaring a const float variable,by const it means your code cannot change its value anywhere in the code.
One other difference is where ever you have used #defined value,that will be treated as double,whereas...Leave a comment:
-
So where are these names to these enum constants are stored?Suppose if i have defined enum but i have'nt created a variable of it,then when i am trying to access any member of it,i still get the right value.Where are these names fetched from?Leave a comment:
-
How to print address of enum?
As i read size of enum is sufficient enough to hold any integer value,thus its 4 bytes in my machine.
...Code:typedef enum{ Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday }weekday; void main() { weekday day=Tuesday; printf("%d\n",day);// prints 1,correct printf("%d\n",Wednesday);//Prints 2!How -
I am using linux and gcc. If somebody can also post some link where i can find details about memory mapping of a process,that will be of great help.Leave a comment:
-
Does each running program / process have its own stack, and a heap too?
"The heap grows and the stack decreases, both approach towards each other, if they crosses each other, program crashes"
I have read this at a number of places but am confused in it. Each running program/process has its own stack, and a heap too? Heap is separate for each program or common for n number of processes?Last edited by Niheel; Mar 11 '11, 05:45 AM. -
Malloc and calloc,real difference?
Thats it?Is there any other major difference between the two other than no of arguments and initialization to 0?Code:calloc(sizeof m,n); //is equivalent to int *p=malloc(m*n); memset(p,0,sizeof m*n);
-
Ok,so compiler expects me to write main() as either of the following:
No...Code:1.void main(){} //I can use neither argc,argv nor env 2.void main(int argc){} //I can only use argument count,but not argv or env 3.void main(int argc,char **argv) //I can use argument count, argv but not env 4.void main(int argc,char **argv, char **env) I can access all.Leave a comment:
-
Ohk,didnt knew about that.But as you are saying ATLEAST 2 arguments is what i am not getting.
as i have observed that
works fine!.Then why notCode:void main(int argc)
works?Code:void main(char **argv)
Leave a comment:
-
i am sorry i didnt get you,you said atleast 2 arguments,what other arguments can be passed to main?how?Leave a comment:
-
Why main() works also only with argc but not argv?
I am confused in command line arguments to a C program a little bit.
The argc maintains the count of the arguments passed and argv is array of vector to these arguments.But when i do :
It does the required job.But if i do:Code:void main(int argc) { printf("%d\n",argc); }
i get a warning and...Code:void main(char **argv) { printf("%s\n",argv[0]); }
No activity results to display
Show More
Leave a comment: