cut -d" " -f2 ${2} | $callsTo
hello, can somebody please explain can I pipe the result of cut to variable callsTo, and how will it be stored, as the string or list?
I'm workin on C-Shell, can somebody help me find the bug, my script:
#! /bin/tcsh -f
cut -d" " -f2 ${1} | ./rankHelper
script rankHelper:
#! /bin/tcsh -f
set line = ($<)
while(${#line} != 0)
cat $line
set line = ($<)
end
file lines from which the data was sent:
053-3787837 038280083
052-3436363 012345678
053-3232287 038280083
054-3923898 033333333
052-2222333 012345678
052-1111111 012390387
I run it using:
> ./rank lines
why do I receive only one number
038280083
I thought cut must cut 2 field from all rows... thanks in advance for any help
I expect to see second field from all rows from lines
I have this snippet of the code:
header
class A {
private:
int player;
public:
A(int initPlayer = 0);
A(const A&);
A& operator=(const A&);
~A();
void foo() const;
friend A& operator=(A& i, const A& member);
};
operator=
A& operator=(A& i, const A& member){
i(member.player);
return i;
}
and I have row in my code:
i = *pa1;
A *pa1 = new A(a2);
at the beginning i was int
how can I fix it, thanks in advance
I have an error must be non-static function
I have this class:
class A {
private:
int player;
public:
A(int initPlayer = 0);
A(const A&);
A& operator=(const A&);
~A();
void foo() const;
};
and I have function which contains this row:
A *pa1 = new A(a2);
can somebody please explain what exactly is going on, when I call A(a2) compiler calls copy constructor or constructor, thanks in advance
hello, can I have this snippet of the code:
C *pa1 = new C(c2);
and I transfer it to another function:
foo(pa1);
what exactly do I transfer actual pointer or its copy, thanks in advance
and can somebody give some info about in which cases info is copied, and in which I transfer actual pointer
hello I've got error a1 was not declared in this scope, can somebody please explain me my fault
my header:
#ifndef QUIZ_H_
#define QUIZ_H_
#include "quiz.cpp"
class A {
private:
int player;
public:
A(int initPlayer);
~A();
void foo();
};
#endif /* QUIZ_H_ */
implementation of class functions:
#include "quiz.h"
#include <iostream>
using std::cout;
using std::endl;
A::A(int initPlayer = 0){
player = initPlayer;
}
A::~A(){
}
void A::foo(){
cout << player;
}
my main
#include "quiz.h"
int main()
{
quiz(7);
return 0;
}
function quiz:
#include "quiz.h"
void quiz(int i)
{
A a1(i);
a1.foo();
}
hello to everyone, I'm looking for some tutorials which can teach about graphics on C, I tryed find it, but all I can find are discussions about special topics, I'm beginner, thanks in advance
I have this snippet of the code:
set calls = `cut -d" " -f2 ${2} | grep -c "$numbers"`
set messages = `cut -d" " -f2 ${3} | grep -c "$numbers"`
@ popularity = (calls * 3) + messages
and error
@ expression syntax
what does it mean? grep -c returns number, am I wrong, thanks in advance
in $numbers I have list of numbers, 2 and 3 parameters also contain numbers
I was looking for some information about virtual table, but can't find something easy to understand, can somebody give me good example(not from Wiki, please), with explanations, or link, thanks in advance