Please Scroll Down to See Forums Below
napsgear
genezapharmateuticals
domestic-supply
puritysourcelabs
UGL OZ
UGFREAK
napsgeargenezapharmateuticals domestic-supplypuritysourcelabsUGL OZUGFREAK

Any C++ programmers??? Please I need some help!

man, I hate to be a jerk, but how do you not how to do that yet are in the class? does the prof teach you the stuff prior to the assignment?
I never went to clas, so that was why I was confused in school - then I'd go to class and I'd be like - "oooohhh, that's how they know how to do this shit"

you need to look into reading about the string class and how it really works (hint, it is an array with a char in each spot of the array and an end of line at the end).

are there regular expressions available in C++? it has been awhile since I've worked in it. I know there are in Java...
 
I agree w/ Happy - there are lots of C/C++ refs for string functions - maybe look in the library for String.h or something. Hell, if a blond can do it, I'm sure you can. :P

A couple options I can think of off the top of my head (left programming a couple years ago, so I'm kinda rusty):

- if you are reading the string in from a command line, put the function parameters into the arg [] array.

- I vaguely recall a function where you can read a string in and with the format of the call

<cant' remember the damn function name> (string, param1, param2, param3, etc)

if you know the exact form of the string

Else do the old loop where you identify a "token" separating each item in the string, such as a space, and loop through the string until "\n" or whatever end delimiter, reading each component of the string into an array, where the loop counter is the array index.

There are examples of all of these in any standard C/C++ reference.

Code to live / live to code! :D
 
HappyScrappy said:
warik - you are too helpful - let them learn :)

If I said exactly what was on my mind whenever anyone asks me for programming help, no one would ask me again; however, everyone would think I'm a ruthless asshole (as if they don't already think so!)

-Warik
 
Warik said:


If I said exactly what was on my mind whenever anyone asks me for programming help, no one would ask me again; however, everyone would think I'm a ruthless asshole (as if they don't already think so!)

-Warik

"Think" ?? come on, we all know you are a ruthless asshole.
nothing wrong with that :)
 
Warik, I guess I'll look for support elsewhere if I have any questions on Visual Basic. I have about zero knowledge of any language. I just picked up a new book by John Smiley. This book is the best I have read so far. It teaches the knuckleheads like me who know nothing about programming some of the basics. I have a Wrox press book that I may get into later called begining Visual Basic 6. It lost me in the first chapter, it was geared more for a C++ guy learning VB. You guys know of any other good books for VB, beginner speed?
 
hell, the msdn site is a great reference. (http://msdn.microsoft.com) that's why its there. I used to use it everyday until I became the all knowing god that I am today.

I know VB, VBScript, I know C++ (although haven't used it in ages), C, Perl, Java, JavaScript, SQL, XML/XSL, WML, ASP (well, technically that is pretty much vbscript), and PHP.

I'll gladly answer questions on any of them if they are specific - if they are vague then I'm likely to just want to give you "hints" so that you can actually read about it and learn something instead of knowing that for that part you can just ask someone how to do it. ask once and then learn to do it yourself forever. too many people just rely on asking the smart programmers and we waste our time answering questions all the time (not a waste if you actually learn and aren't gonna come back and ask the same question again the next day).
 
I am really not clear on what you are trying to do with respect to breaking up the string to pass to the execute function?? If you can elaborate then I can help you.

btw, the absolute best book that you should get on introductory C++ programming is:

How to Program C++ by: Deitel & Deitel

This is the ultimate beginners reference and it's affordable.
 
Sorry, I reread the question and now I understand what you have to do.

Sassy is basically correct. Every C/C++ program should have an entry point function called main:

In C:
void main (char* arg, char** args)
{
//arg = the number of parameters inputted from the console

//args = an array which contains all the arguments.
}


In C++
void main()
{
char * a;
cin >> a;
}

in C++ "cin" is an overloaded operator that handles all the pain in the ass work of fucking with the argument parameter in C command line programs.

I am not 100% sure about the syntax but I know I am really close. Most of my work as of late has been in Java so my C++ is a little weak at the present moment.

Let me know if you need any help.

The Doc
 
also The C++ Programming Language Special Edition
by Bjarne Stroustrup would be a good one since he was the one that got it started - just as the Kernighan/Ritchie was the one to read for C since they started it...
 
Ahhhhh.... the good ol' K&R. Right up there among my favorite refs, like Scott Adams' "The Dilbert Principle"..... Also have a copy of Stroustrap and the ever lovin MSDN.

Brings back fond memories of 5 am in the computer lab trying to finish my CS assignments, and then 3 days straight on the computer when I started working. The joy of it all.

Damn I'm glad I'm in marketing now.... (Well actually, anyone else have a good suggestion for another career ... kinda getting sick of corporate america in general....
 
the best thing about java is how slow it runs... on all machines.
amazing really.
easy to program in though - hard to deploy effectively.
 
Java is great for server development but horrible for client side and embedded systems. Its very slow in certain respects, but then extremely scaleable.

In my opinion you don't learn anything about computer science from programming in java because all your memory management is being handled for you.

The Doc
 
For a UNIX shell, why are you using C++?


argv & argc are going to contain your command line entries. This should be done in C.

Look in <unistd.h>
 
Java is way easy to code in and 99% of shit is already done for you, but it's terribly slow. Whose stupid idea was platform independence anyway? If you want to run a program on a Mac, get the Mac version. Java would have been a great success if you could just build an EXE and run it on Windows or whatever just as fast as you would do so for a C++ program. Instead you have to go through a bunch of command line BS just to execute a damn file.

It's no wonder you see 99% of Java apps on the web in the form of applets.

Too bad my school didn't teach C++ as well as it's teaching Java. I should retake C++ with my Java teacher. =)

-Warik
 
In my opinion you don't learn anything about computer science from programming in java because all your memory management is being handled for you.

One of Meyer's requirements of a pure OO language is automatic memory management. C++ isn't truly an OO language, it is extension of C.
 
Womb Raider said:


One of Meyer's requirements of a pure OO language is automatic memory management. C++ isn't truly an OO language, it is extension of C.


You do have garbage collection in C++. But, I do agree that it's not fully OO.
 
natasan said:
You do have garbage collection in C++. But, I do agree that it's not fully OO.

Umm no, it doesn't. If it did, could you please tell me the purpose of delete/free/auto_ptr/COM ref counting/etc?

Oh and I can't believe all you guys fell for it and replied to this post! It's a trick by the girls to see who here are the big geeks! BWHAHAHAHAHA! Good thing I don't know a thing about programming :rolleyes:
 
Safe, Efficient Garbage Collection for C++

http://citeseer.nj.nec.com/ellis93safe.html

I don't mind being a geek. I'm probably the only Philosophy Major here working towards a CISSP and still makes it to the gym at least 15 hours a week.

I could care less what any of these girls thinks because I show my geeky side on either computers, supplements, dieting (my girlfriend teases me the most when I diet), or anything else.

I just post help to things I can help with.
 
I'm a computer science major. I'm just curious to know if any of you guys or girls that are in the computer business like what you are doing. Are the classes pretty tough when you move up in school? Do you still get to talk to people when you have a job with computers? Or are you in front of a screen all day?

Thanks,
stretch
 
I'm from the old school (pre-Internet) - generally CS people can get paid a lot in starting/entry level positions and they are really in demand (vs. 15 yrs ago when I started). But within a corporation sometimes you hit a ceiling - like you start out as a jr. or associate software engineer, then after you put in some time, you get to be a sr. software engineer. Afterthat, there's really only group leaders, and then managers. And most computer people prefer to design/develop than manage the daily corporate BS. Unless you continue up the "technical staff" track - this is usually reserved for the PhDs who like to architect things.

The formal stuff they teach you in college, particularly database stuff, programming style, somtimes statistics, and some management stuff is good. Most companies like to have "process" (read: software development lifecycle) so it helps if you have good documentation skills for functional requirements and stuff as well as following good programming practices to promote "usability" of your code (good commenting, modular programming, etc.).

But the really good stuff to know is stuff that will allow you do something besides the std corporate thing. This includes network certifications (MSCE, CCNA, etc.) as well as stuff that is mindless to learn on your own like HTML and website stuff.

The internet makes so many more things accessible to joe average - so go ahead and pursue some wild things if you want - run your own porn site, do hosting on a server under your bed, etc. etc. If you hang around in a corporation, welcome to the cube farm.

I bet some of the guys who responded to the C/C++ question can give you more insight.
 
hey sassy, you weren't pre-internet - you were pre-internet boom. big difference.

what sassy says is pretty much how I feel as well. cube life can suck if the people around you don't speak english all that well - but if they do and you have some people your age around as well, it isn't so bad.

I've got it easy b/c I didn't take too many comp sci classes in college/high school and have taught myself most of what I know. so I have the good job which pays pretty well and I didn't have to sit through boring comp sci labs or early classes... or I didn't sit through many of them.

the biggest problem with prgogrammers IMO is that it is very easy to burnout. I'm feeling kind of fried at the moment. be careful of that - you can make more money if you work more, but you will burn out quicker... or more quickly - never was any good at that english thing :)
 
HS -

I guess it was pre-internet from the job market standpoint. My high school got its first XT the year after I graduated and I my first year of programming was done on a VAX/1170 and had a BITNET account. Missed doing punch cards by 1 semester! We actually had a printer interface type computer and there was a PDP 11 sitting somewhere in the lab back then.

The biggest problem w/ software engineering is the expectations. Burn out happens because people don't know how to schedule projects, most everything doesn't work for most of the schedule (which was driven by some sales guy trying to get a deal closed), the requirements change every freakin day and then when the deadline comes, everyone is sleeping under their desk because the time you spend driving home could be used for more programming. ARRRRRRRRRRRRRRRRRRRRRRRGH. Been there, done that.

One good thing about contracting is that you can work your butt of for a period of time, and then take off a month or 6 if you want. The internet also makes "telecommuting" a very strong alternative to getting up in time to beat traffic in the morning.

I now work in marketing so we can specify "customer requirements" and leave it up to the developers to implement. With all the new communication technology emerging, I'm having a field day identifying new product opportunities!!!! Here's one of my requirements docs:

Opportunity: New mobile technology
Target Market: anyone who will buy this shit
<insert a pie chart>
Revenue Opportunity: the industry analysts predict $100000000 Billion in revenue over the next 3 years
<insert your favorite S-curve diagram>
Customer Requirements:
- mobile
- really complicated, flashy interface
- makes lots of whirring noises when you press the button
- must have an antenna
- include the words "communication", "IP" and "open standards" somewhere in the implentation detail.
Support:
- online help page that links to "Error 404 - file not found" page.
- 800 number that allows the company to user your line for foreign country dial-back services.


Its great to be in marketing!
 
I'm trying to switch from consulting on the side over to all freelance stuff, but it isn't proving all that easy.
I'd definitely love to work form home and be able to take naps and stuff.
I'd say it'd be great to program in my underwear too - but I do that here at work anyway :)
 
Dr. E said:
How to Program C++ by: Deitel & Deitel

Dr. E has risen to the top of my lunatics list. Dietel & Dietel is a good C++ book IF you have some prior programming experience OR are simply looking for a reference. Trying to read that thing hurt my damn eyes so much because of the annoying font and tendency to bold so much text.


I am a developer and I love my job. I am almost entirely self-taught, also, because my schooling was principally in mathematics.

Being a consultant keeps things fluctuating constantly -- Always interesting and always learning.
 
Stretch-

I like what I'm doing and I'm quite an introvert so I enjoy not having to deal with people all day, especially stupid annoying people, who I could give a rat's ass about thieir family/social life etc. Plus there's no hot chicks here so what's the point. I could definitly spend time shooting the shit w/ other employees if I wanted to. Maybe I would if I worked in another company.

I wasn't a CS major in school so I can't tell you if they get harder or not. I guess the typical program will teach you programming, then OO design, computer architecture, databases, compiler theory, OS, discrete math, digital logic, etc...I wouldn't think it gets much harder, it will just branch out. I would hope that your program will let you specialize in whatever area interests you and you can follow that path.

It's a good field to be in and for me, it seems the more you learn, the more you realize how little you know.
It keeps me challenged and when I'm working on an interesting project, and am making progress, you get a sense of self-satisfaction and the day seems to fly by.

I'm pretty new to the field. I try to read as much as I can. I do an hour of cardio every morning so I bring a CS book with me - that also helps the cardio time go by.
I haven't experienced the burnout effect but I haven't been put into any stressfull situations yet.
 
Womb Raider, Happy Scrappy, Puc, and Sassy69,
thanks for the feedback.

I'm in the early stages of my computer science education, but as of now, I'm planning on getting a doctorate in it. My only drawback is the fact that I'm working with machines and not people. I really like to work with people, but I figure with a degree in CS I can get a job doing just about anything.

If you have anymore feedback, please let me know.

Thanks again,
stretch
 
C++ have garbage collection?? Certainly not pure C++ based on the STL. As far as my COM knowledge goes, isn't the memory allocated for smart pointers garbage collected when they are released?

Writing a garbage collector is not that hard but it is a fair amount of overhead.

As for the people asking about the computer industy:

When you first get out, try to stay away from the big computer companies until you get some experience and can be catapaulted into a cool job. I work for a young startup and have a tremendous responsibility. sometimes I am architecting, sometimes I am coding, and sometimes I am just messing around.

I have friends writing code for IBM, Microsoft, Cisco, just about every big name computer company, and as much as they like there job, they don't have enough influence in the direction of the company to feel that they are making a significant impact.

As for the Deitel & Deitel book reference, the font does suck, but for the price and content it's worth it. Also, the C++ Programming Language by Stroustrup is a great reference for C++, and the C programming Language by Dennis Ritchie is an amazing reference.
 
I'm planning on getting a doctorate in it.

Those extra degrees won't help you much in the IT world but if you're really interested in research/teaching then go for it. 3 years experience vs 3 yrs in grad school, employers will pick the former.
 
PhD in cmputer science means less nothing at all in the industry.

However, if your background is like mine (computer engineering), and you have chosen to study hardware in greater depth, then a PhD is awesome in that industry.

MBA is the number one thing in the field when it comes to getting sweet ass jobs!

The Doc
 
just curious. I work for a consultantcy in burlington. I'm on the infrastructure side of the business. Hopefully I can make my way over to the dev side.
 
I agree w/ Dr. E. Computer science is basically the ability to understand basic computer concepts and language, with some math & stats and DBA. Once you get that you can teach yourself most of the stuff like Java, HTML, etc.

The thing you don't want to do in school is get roped into thinking you can't be creative on your own. An MBA counts for a lot, or at least looks good, particularly if you get one of those fancy e-commerce MBAs from Harvard or something. But if you have good business sense, can write a good business plan with somethign people want to spend money on , you can do great.

Something like pre-sales engineering or working for an integrator seems like the way to go - learn that, get some more network knowledge under your belt and you are worth lots! Its not necessary to get the college degrees up the ying yang.
 
Top Bottom