Do not go into programming.

News and important info, general banter, and suggestions for 5punk

Moderator: Forum Moderators

Post Reply
deject
Berk
Berk
Posts: 10353
Joined: December 7th, 2004, 17:02
Location: Oklahoma City, OK, USA
Contact:

Do not go into programming.

Post by deject »

Code: Select all

In file included from circle.cpp:1:
circle.h:5: syntax error before `:' token
circle.h:12: `point' was not declared in this scope
circle.h:12: syntax error before `,' token
circle.h:12: ISO C++ forbids declaration of `circle' with no type
circle.h:13: `circle' was not declared in this scope
circle.h:13: syntax error before `)' token
circle.h:13: ISO C++ forbids declaration of `circle' with no type
circle.h:16: syntax error before `)' token
circle.h:17: `double' fails to be a typedef or built in type
circle.h:17: ISO C++ forbids declaration of `get_radius' with no type
circle.h:17: non-member function `int get_radius()' cannot have `const' method 
   qualifier
circle.h: In function `int get_radius()':
circle.h:17: `radius' undeclared (first use this function)
circle.h:17: (Each undeclared identifier is reported only once for each 
   function it appears in.)
circle.h: At global scope:
circle.h:18: `point' was not declared in this scope
circle.h:18: syntax error before `)' token
circle.h:18: `void' fails to be a typedef or built in type
circle.h:18: ISO C++ forbids declaration of `set_center' with no type
circle.h:19: `void' fails to be a typedef or built in type
circle.h:19: ISO C++ forbids declaration of `set_radius' with no type
circle.h:19: `double' fails to be a typedef or built in type
circle.h:19: ISO C++ forbids declaration of `inrad' with no type
circle.h:22: `circle' was not declared in this scope
circle.h:22: syntax error before `,' token
circle.h:22: `bool operator!=(...)' must have an argument of class or 
   enumerated type
circle.h:22: `bool operator!=(...)' must take exactly two arguments
circle.h:23: `double' fails to be a typedef or built in type
circle.h:23: ISO C++ forbids declaration of `area' with no type
circle.h:26: `circle' was not declared in this scope
circle.h:26: syntax error before `,' token
circle.h:26: friend declaration not in class definition
circle.h:26: `bool operator==(...)' must have an argument of class or 
   enumerated type
circle.h:26: `bool operator==(...)' must take exactly two arguments
circle.h:30: `double' fails to be a typedef or built in type
circle.h:30: ISO C++ forbids declaration of `radius' with no type
circle.h:30: `int radius' used prior to declaration
circle.h:31: syntax error before `}' token
circle.h:34: `circle' was not declared in this scope
circle.h:34: `a' was not declared in this scope
circle.h:34: syntax error before `&' token
circle.h:34: `void' fails to be a typedef or built in type
circle.h:34: ISO C++ forbids declaration of `shift' with no type
circle.h:35: syntax error before `&' token
circle.h:36: syntax error before `&' token
circle.cpp:4: syntax error before `::' token
circle.cpp:6: ISO C++ forbids declaration of `radius' with no type
circle.cpp:6: redefinition of `int radius'
circle.h:30: `int radius' previously declared here
circle.cpp:6: warning: initialization to `int' from `double'
circle.cpp:6: warning: argument to `int' from `double'
circle.cpp:7: syntax error before `}' token
circle.cpp:9: syntax error before `::' token
circle.cpp:11: ISO C++ forbids declaration of `radius' with no type
circle.cpp:11: redefinition of `int radius'
circle.cpp:6: `int radius' previously defined here
circle.cpp:11: `rad' was not declared in this scope
circle.cpp:12: syntax error before `}' token
circle.cpp:14: syntax error before `::' token
circle.cpp:16: ISO C++ forbids declaration of `radius' with no type
circle.cpp:16: redefinition of `int radius'
circle.cpp:11: `int radius' previously defined here
circle.cpp:16: `x' was not declared in this scope
circle.cpp:17: syntax error before `<<' token
circle.cpp:20: syntax error before `::' token
circle.cpp:24: syntax error before `::' token
circle.cpp:28: syntax error before `::' token
circle.cpp:35: syntax error before `::' token
circle.cpp:40: `circle' was not declared in this scope
circle.cpp:40: syntax error before `,' token
circle.cpp:40: `bool operator==(...)' must have an argument of class or 
   enumerated type
circle.cpp:40: `bool operator==(...)' must take exactly two arguments
circle.cpp: In function `bool operator==(...)':
circle.cpp:41: `a' undeclared (first use this function)
circle.cpp:41: `b' undeclared (first use this function)
circle.cpp: At global scope:
circle.cpp:47: syntax error before `,' token
circle.cpp:47: `void' fails to be a typedef or built in type
circle.cpp:47: ISO C++ forbids declaration of `shift' with no type
circle.cpp: In function `int shift(...)':
circle.cpp:49: `x_move' undeclared (first use this function)
circle.cpp:49: `y_move' undeclared (first use this function)
circle.cpp:49: `temp' undeclared (first use this function)
circle.cpp:49: `circle' undeclared (first use this function)
circle.cpp: At global scope:
circle.cpp:52: syntax error before `&' token
circle.cpp:54: 'point' is used as a type, but is not defined as a type.
circle.cpp:55: syntax error before `<<' token
circle.cpp:56: syntax error before `>>' token
circle.cpp:57: syntax error before `<<' token
circle.cpp:58: syntax error before `>>' token
circle.cpp:59: syntax error before `<<' token
circle.cpp:60: syntax error before `<<' token
circle.cpp:61: ISO C++ forbids declaration of `cent' with no type
circle.cpp:61: `x_pos' was not declared in this scope
circle.cpp:61: `y_pos' was not declared in this scope
circle.cpp:61: `point' was not declared in this scope
circle.cpp:62: ISO C++ forbids declaration of `a' with no type
circle.cpp:62: `int a' used prior to declaration
circle.cpp:62: `cent' was not declared in this scope
circle.cpp:62: `rad' was not declared in this scope
circle.cpp:63: syntax error before `return'
circle.cpp:66: syntax error before `&' token
make: *** [circle.o] Error 1
Dr. kitteny berk
Morbo
Morbo
Posts: 19676
Joined: December 10th, 2004, 21:53
Contact:

Post by Dr. kitteny berk »

IF TYPING = 0 THEN CODE = 0
spoodie
Site Moderator
Site Moderator
Posts: 9246
Joined: February 6th, 2005, 16:49
Location: Essex, UK

Post by spoodie »

All that just to make a circle! Here's one I made for you and even added so extras, I didn't make an errors either

Image
Dr. kitteny berk
Morbo
Morbo
Posts: 19676
Joined: December 10th, 2004, 21:53
Contact:

Post by Dr. kitteny berk »

spoodie wrote:All that just to make a circle! Here's one I made for you and even added so extras, I didn't make an errors either

Image
FatherJack
Site Owner
Site Owner
Posts: 9597
Joined: May 16th, 2005, 15:31
Location: Coventry, UK
Contact:

Post by FatherJack »

Programming would be a blessed relief from the world of shit I currently inhabit as a specialist of a system currently being emasculated as the ultimate root of all evil and cause of all problems whilst simultaeously being tasked with the specification of its replacement.
spoodie
Site Moderator
Site Moderator
Posts: 9246
Joined: February 6th, 2005, 16:49
Location: Essex, UK

Post by spoodie »

You mod haxed that in :ignore:
deject
Berk
Berk
Posts: 10353
Joined: December 7th, 2004, 17:02
Location: Oklahoma City, OK, USA
Contact:

Post by deject »

Dr. kitteny berk wrote:
spoodie wrote:All that just to make a circle! Here's one I made for you and even added so extras, I didn't make an errors either

Image

pffffft!
FatherJack
Site Owner
Site Owner
Posts: 9597
Joined: May 16th, 2005, 15:31
Location: Coventry, UK
Contact:

Post by FatherJack »

Dr. kitteny berk wrote:
spoodie wrote:All that just to make a circle! Here's one I made for you and even added so extras, I didn't make an errors either

Image
Dr. kitteny berk
Morbo
Morbo
Posts: 19676
Joined: December 10th, 2004, 21:53
Contact:

Post by Dr. kitteny berk »

pffft.
spoodie
Site Moderator
Site Moderator
Posts: 9246
Joined: February 6th, 2005, 16:49
Location: Essex, UK

Post by spoodie »

stop mod editing errors into my error-free posts :shakefist:

:)
TezzRexx
Dr Zoidberg
Dr Zoidberg
Posts: 4072
Joined: February 8th, 2005, 15:54
Location: BURMINGHUM, England
Contact:

Re: Do not go into programming.

Post by TezzRexx »

deject wrote:Don't go into Python programming
FIX'D
deject
Berk
Berk
Posts: 10353
Joined: December 7th, 2004, 17:02
Location: Oklahoma City, OK, USA
Contact:

Post by deject »

:boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie:
:boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie:
:boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie:
:boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie:
:boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie:
:boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie:
:boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie: :boogie:

Code: Select all

g++ -g -c circle.cpp
In file included from circle.cpp:1:
circle.h:37: `istream' was not declared in this scope
circle.h:37: `ins' was not declared in this scope
circle.h:37: syntax error before `&' token
circle.h:37: `std::istream& operator<<(...)' must have an argument of class or 
   enumerated type
circle.h:37: `std::istream& operator<<(...)' must take exactly two arguments
circle.h:38: `ostream' was not declared in this scope
circle.h:38: `outs' was not declared in this scope
circle.h:38: syntax error before `&' token
circle.h:38: `std::ostream& operator>>(...)' must have an argument of class or 
   enumerated type
circle.h:38: `std::ostream& operator>>(...)' must take exactly two arguments
circle.cpp: In function `void shift(circle&, double, double)':
circle.cpp:51: request for member `get_y' in `a->circle::get_center() const', 
   which is of non-aggregate type `<unknown type>'
circle.cpp: In function `std::istream& operator>>(std::istream&, circle&)':
circle.cpp:61: `radius' undeclared (first use this function)
circle.cpp:61: (Each undeclared identifier is reported only once for each 
   function it appears in.)
circle.cpp:64: syntax error before `:' token
circle.cpp: In function `std::ostream& operator<<(std::ostream&, circle&)':
circle.cpp:68: no matching function for call to `circle::get_x()'
circle.cpp:68: no matching function for call to `circle::get_y()'
make: *** [circle.o] Error 1

almost done!
Woo Elephant Yeah
Heavy
Heavy
Posts: 5433
Joined: October 10th, 2004, 17:36
Location: Bristol, UK
Contact:

Post by Woo Elephant Yeah »

ImageImageImage
ImageImageImage
ImageImageImage
Hehulk
KHAAAN!
KHAAAN!
Posts: 4746
Joined: April 18th, 2005, 15:36
Location: Bummingham, England
Contact:

Post by Hehulk »

Woo Elephant Yeah wrote:ImageImageImage
ImageImageImage
ImageImageImage
LIES!
spoodie
Site Moderator
Site Moderator
Posts: 9246
Joined: February 6th, 2005, 16:49
Location: Essex, UK

Post by spoodie »

Here's some code what I wrote recently. It's for adding user accounts to newly installed Linux servers, basic stuff but isn't it pretty.

Code: Select all

#!/bin/bash

passwd=${MNT_PT}/misc/passwd
shadow=${MNT_PT}/misc/shadow
lineid=1

if [[ ! -r $passwd || ! -r $shadow ]] ; then
        echo "ERROR: user files not found"
        exit 1
fi

linecount=$(wc -l $passwd | awk '{print $1}')
shadowcount=$(wc -l $shadow | awk '{print $1}')

if [[ ${linecount} -ne ${shadowcount} ]] ; then
        echo "ERROR: line count mismatch"
        exit 1
fi

while [[ ${lineid} -le ${linecount} ]]
do
        line=$(sed -n ${lineid}p ${passwd})

        name=$(echo ${line} | cut -d':' -f1)
        uid=$(echo ${line} | cut -d':' -f3)
        gid=$(echo ${line} | cut -d':' -f4)
        comment=$(echo ${line} | cut -d':' -f5)
        home=$(echo ${line} | cut -d':' -f6)
        shell=$(echo ${line} | cut -d':' -f7)

        pword=$(grep -e "^${name}:" ${shadow} | cut -d':' -f2)

        grep -q ":${gid}:" /etc/group 2> /dev/null
        if [[ $? -ne 0 ]] ; then
                echo "Adding group: ${name}"
                groupadd -g $gid $name
        fi

        grep -q "^$name:" /etc/passwd 2> /dev/null
        if [[ $? -ne 0 ]] ; then
                echo "Adding user: ${name}"
                useradd -u $uid -g $gid -d $home -s $shell -c "$comment" -p "$pword" -M $name
        fi

        (( lineid+=1 ))
done
Lateralus
Dr Zoidberg
Dr Zoidberg
Posts: 4217
Joined: May 15th, 2005, 15:20

Post by Lateralus »

Hehulk wrote:
Woo Elephant Yeah wrote:ImageImageImage
ImageImageImage
ImageImageImage
LIES!
HAX! VIDEOTAPE!
Post Reply