- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
If u type top command in terminal u will get like this.......... For eg. PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 31253 user1 16 0 2112m 2.1g 1764 R 37.0 53.2 0:39.89 firefox 31249 root 16 0 2112m 2.1g 1764 R 15.5 53.2 0:38.29 gtk-gnash … |
|
Hi everyone, I don't know how to calculate cpu and memory usage information of a process.I know this information is located in /proc/pid/... but where............because i want to display this information in C++ without using "gliptop" library........... Please help me ........even if possible i need "top" command source code in … |
|
Hi everyone, I want to write a code in C++ so i want to knw information about /proc in liux . where if we give the command "top" in terminal it will show all currently running information like this if i want to display these information using C++ code .so … |
|
Hi everyone I want to open the Directory like this using C++ in linux eg : /proc/1/status where proc and 1 is a directory and status is a file,which i want to access(i.e)this file i have to copy to an string to access some information..................can anyone help |
|
Re:
Command line arguments in C #include<stdio.h> int main(int argc,char *argv[]) { FILE *fp; char c; if(argc==2) { fp=fopen(argv[1],"w"); while((c=getchar())!=EOF) { putc(c,fp); } fclose(fp); fp=fopen(argv[1],"r"); while((c=getc(fp))!=EOF) { printf("%c",c); } fclose(fp); } return 0; } How to run this program in linux? I have tried these steps: 1. open terminal in linux … |
|
why computer takes more execution time when a function is called ? i want theoritical explanation.............that is what happens internally.......... this is diadvantages of Function Why it takes more execution time ? |
|
I want database management in C To ADD,LIST,DELETE,INSERT using structures and files..........not in linked list.............. can anyone help me out....because this is the first time to do long and some what complex program for me |
|
[code]#include<stdio.h> #include<stdlib.h> #include<string.h> struct name { int a; char b[10]; char c; }; int main() { struct name *p; p = (struct name *)malloc(3 * sizeof(struct name)); char *n; n = "12345"; n = (char *)p; n = (int*)n; /*this is not correct . in doubt....change correctly*/ strcpy(n+(sizeof(p->a)),"ALL"); *(n+sizeof(p->a)+sizeof(p->b)) = … |
|
{ int i = 25789; char *p; .............. .............. printf("%d",*p); /* (*p) should give in printf*/ } dont assign p=i ............apart from this how we can typecast this program so that we can get interger value tp pointer p.............please help me this |
|
[code]#include<stdio.h> #include<stdlib.h> #include<string.h> struct name { int *a; char b[10]; char c; }; int main() { struct name *p; p = ( struct name * ) malloc ( 3 * sizeof ( struct name ) ); char *n; n = ( char * ) p; *n = 275; strcpy ( … |
|
[code] #include<stdio.h> #include<stdlib.h> #include<string.h> struct name { int a; char b[10]; char c; }; int main() { struct name *p; char *n; n = (char *)malloc(3 * sizeof(char)); // in this why 3 means.. its my condition n = (char *)p; n->a = 3; // this line is showing error … |