Forum: Shell Scripting Sep 30th, 2009 |
| Replies: 1 Views: 607 hi all
i want to add a pattern (say XYZ) after variable $lineNum in some tempFile.
How do i do this, preferably using sed ?
for eg.
Initially
line 1
line 2 |
Forum: Shell Scripting Sep 23rd, 2009 |
| Replies: 2 Views: 600 if line 5 of a file needs to be replaced with contents of $line, how could we possibly do this using sed ? |
Forum: Shell Scripting Sep 23rd, 2009 |
| Replies: 1 Views: 558 My input file looks like this
abc def \
ghi jkl && mno || hju
My objective:
to replace '\' with line 2
newLine=`sed -n "2 p" inputFile` |
Forum: Shell Scripting Sep 23rd, 2009 |
| Replies: 6 Views: 796 Thanks for the input. I am using a win ox (cygwin) . What could be the possible workaround ? |
Forum: Shell Scripting Sep 23rd, 2009 |
| Replies: 6 Views: 796 Hi
i am trying to write a script to match a '\' at the END of the line.
For eg. i have a file Temp1 which contains :-
a = b + c \
+d;
printf("\n"); |
Forum: C++ Aug 31st, 2008 |
| Replies: 1 Views: 766 class A
{
int x;
public:
A(){}
~A()
{
cout<<this<<endl<<"bye"<<endl;
}
}; |
Forum: C++ Aug 31st, 2008 |
| Replies: 2 Views: 761 why is the size of an empty class 1 byte ? does the compiler add some null byte ? |
Forum: C++ Aug 31st, 2008 |
| Replies: 1 Views: 1,666 what is the difference between a class declaration and a class definition ?
Is it that a class which contains the prototypes of member functions is a class declaration?
Is it that a class with... |
Forum: C++ Aug 25th, 2008 |
| Replies: 6 Views: 896 class Base
{
public:
virtual void fn(){cout<<"fn base\n";}
virtual void myfn(){cout<<"myfn base\n";}
};
class Derived : private Base
{
private: |
Forum: C Aug 20th, 2008 |
| Replies: 1 Views: 918 how many processes will be created when i fork() twice .
Is this logic correct ?
the 1st fork will spawn child C1 which is a child of the parent process P.
the code segment of the parent P is... |
Forum: C++ Aug 20th, 2008 |
| Replies: 3 Views: 1,024 class A
{
public:
A()
{
cout<<"ctor A\n";
}
virtual void func(int x)
{ |
Forum: C++ Aug 20th, 2008 |
| Replies: 0 Views: 438 i have two classes. One is room and the other is container.Room is the class which you write, container is a 3rd party class, you can't change
the class definition of container.
in the constructor... |
Forum: C++ Aug 3rd, 2008 |
| Replies: 2 Views: 6,064 In Example 11, i expected the virtual ptr for derived class to be at
(int *)*((int *)(&obj)+3)
Hpwever, the VPTR is at
(int *)*((int *)(&obj)+0)
Can some body explain this please? |
Forum: C++ Jul 31st, 2008 |
| Replies: 5 Views: 808 Query 2. When we instantiate an object in C++, a constructor gets called.
How is this implemented internally ?
What is the C++ run time library ? Does it come into the picture ?
I would also want... |
Forum: C++ Jul 31st, 2008 |
| Replies: 5 Views: 808 thanks for the information ArkM. That was of great help. I tried out the following program and this is what i ended up with ( as expected !)
typedef int& Ref;
int a = 8;
int... |
Forum: C++ Jul 30th, 2008 |
| Replies: 5 Views: 808 Thanks ! I got the perspective . What i did want to know was whether this was allowed as part of the ISO Standards for C++ . |
Forum: C++ Jul 30th, 2008 |
| Replies: 5 Views: 808 This one is on References.
http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=/com.ibm.xlcpp8a.doc/language/ref/cplr110.htm
in the above link (from IBM), they clearly... |
Forum: C++ Jul 30th, 2008 |
| Replies: 4 Views: 664 |
Forum: C++ Jul 27th, 2008 |
| Replies: 4 Views: 664 When an object is instantiated, the constructor gets called ? How is this internally implemented ? Who Calls the Constructor ? Is it the OS ? |