User Profile
Collapse
-
Sorry in above mentioned answer, $ps -ef is linux command to display snapshot of current processes not processor. -
You can get PID by typing $ps -ef in your linux terminal. Which shows the processors list which are currently running. Second column in the displayed table is PID. Just grep the processes pid you want to kill and kill it as stated by Raghu....Leave a comment:
-
-
How to configure gdb ?
Hi,
I have implemented strcpy function using arrays. Wantedly i have coded in order to generate segmentation fault. How to debug it using gdb ?
My code snippet :
...Code:#include <stdio.h> #include <string.h> int main() { int i; char *dest="murali"; char *src = "krishna"; strcpy_temp(dest,src); printf("value -
Sorry i forgot "string to replace" in data structure and in logic . Here modified algorithm
Data structures required : newstr,tempstr, searchstring,re placestr,oldstr of string type
1. Read line into "oldstr".
2. Read the string to change into "serachstri ng".
3. Now traverse from postion 0 to \n in oldstr searching for "searchstri ng". while traversing copy the contents...Leave a comment:
-
Sorry i forgot "string to replace" in data structure and in logic . Here modified algorithm
Data structures required : newstr,tempstr, searchstring,re placestr,oldstr of string type
1. Read line into "oldstr".
2. Read the string to change into "serachstri ng".
3. Now traverse from postion 0 to \n in oldstr searching for "searchstri ng". while traversing copy the contents...Leave a comment:
-
Even I have gon through the logic but its totally messed but. Anyway what Raghu suggest is great approach.
One more approach can be.
I assume the input string is a single line.
Data structures required : newstr,tempstr, searchstring,ol dstr of string type
1. Read line into "oldstr".
2. Read the string to change into "serachstri ng".
3. Now traverse from postion...Leave a comment:
-
One doutbt I have, actually string means we say its an array of characters or character array. Is this question mean copying a string to an character array ? Can't we use strcpy for this ?
Mmk...Leave a comment:
-
Yes , Raghu is correct .
The function pointer *fp can be declared as void (*fp)(int), which specifies both the return type (void) and the types of arguments (int) of the function. We then assign the pointer to a particular function, and having done so, can then call the function just as we normally would....Leave a comment:
-
4) what does a cin.ignore() command do?
cin.Ignore function will ignore, consume or pass by a character you specify. Theres two arguments to the ignore function.
Heres the syntax: cin.ignore(num, delimChar); --You can use it with cin or your file object name .
So if we said: cin.ignore(555, '#'); The ignore function stops reading and discarding characters once its consumed the num (555) of characters...Leave a comment:
-
Dear Ganon11,
myvector is a vector object. As i know there is no size() member function in c++ concept. If I am wrong please correct me.
Cheers,
MMk...Leave a comment:
-
Hi Moox,
This worked fine for me.
Thank you and all who responded for my query.
Cheers,
Mmk...Leave a comment:
-
Hi rolan,
I suggest you following code. Anyone please correct me if I am wrong.
Thank you,Code:int *getMatrix(int column, int row){ int sparseMatrix =new int [column][row]; ... return &sparseMatrix[0]; }
Mmk...Leave a comment:
-
Hi Mimimi while trying out your query, i coded in this way but its not working out. Can you please share your code snippet. Anybody can help out me regarding this.
...Code:#include <stdio.h> #define BUFSIZE 100 char buf[BUFSIZE][BUFSIZE]={ 1,3,"Trying",2,4,"out",4,5,"something"}; struct table_entry{ int length; int offset; char *name;Leave a comment:
-
Dear raghu, i tried about what you have suggested. But, still I am facing the problem. Please suggest me how to resolve this.
[code=cpp]
// vector::begin
#include <iostream>
#include <vector>
using namespace std;
int main ()
{
vector<int> myvector;
// Fill vector with 1 to 5 ... 3 times
for (int i=1; i<=5; i++) myvector.push_b ack(i);...Leave a comment:
-
I suggest you first go through any standard books to know more about basics. Once knowing the basic you can go through some tutorials on net. I prefer Kernigan and Ritche book for C-language and Bajarne stroustroup book for C++.Leave a comment:
-
How to print vector element address ?
Hi,
Anyone can suggest me how to print vector element address in c++.
Thank you,
Murali
No activity results to display
Show More
Leave a comment: