2,827 Posted Topics

Member Avatar for ayoitzrimz

Assuming inputFile is type string, looks fine to me. I assume the file actually exists and the permissions are correct, file is available, etc.? To narrow down the bug, try hard-coding the filename. See if it makes a difference. [code] infile.open ("input4.txt"); [/code] But here's a thought. Why are you …

Member Avatar for VernonDozier
0
249
Member Avatar for |hex

Lines 36 through 39 can be deleted. They have no impact. Line 36's condition will ALWAYS evaluate to false. If you have a command like "show automobile", then line 31 will be false since "show" is not the same as "show automobile". I imagine you perhaps don't want to use …

Member Avatar for Fbody
0
178
Member Avatar for TinhornAdeniyi

Glad you solved it. Do yourself a favor and indent. It makes things WAYYYY easier. NetBeans and Visual Studio both have code formatters. You'll spot things so much faster!

Member Avatar for VernonDozier
0
195
Member Avatar for Fadam360

One, use code tags. [noparse] [code] // paste code here [/code] [/noparse] Two, you need to use a nested loop: [code] int i; int j; int someNumber; for(i = 1; i < ??; i++) { for(j = 1; j < ??; j++) { someNumber = ?? * ??; // display …

Member Avatar for muraj
0
169
Member Avatar for LevyDee

I'd say don't include it unless they ask for it. They may have a very specific format of how they want it. Follow that format to the letter if it's provided. Otherwise, if they ask for a resume and a cover letter, just give them that. An attachment might not …

Member Avatar for VernonDozier
0
99
Member Avatar for Fadam360

[QUOTE=Fadam360]Hello everyone, I need to make a program for Java...[/QUOTE] You're in the wrong forum then. Please mark this solved and start a new thread in the Java forum. Thanks.

Member Avatar for VernonDozier
0
81
Member Avatar for Krokcy

You say you removed some of the code. You clearly did, but you removed too much. What's the prog[] array? Way too many goto statements here. I'm not one of those purists who insist on no goto statements, but there needs to be a really good reason and all it …

Member Avatar for VernonDozier
0
1K
Member Avatar for Philosophy

In addition to what StuXYZ said, I suggest using smaller test cases than 777 and 7777. It'll break at 9, calling it prime. That's because, as StuXYZ mentioned, due to the break statements, you don't really have a loop and thus don't test for anything higher than 3.

Member Avatar for Philosophy
0
176
Member Avatar for Panda.

Programming is a big field. Should you learn C++? It depends. Most people end up specializing. A big fork in the road is interpreted languages (Python, Perl) versus compiled languages (C, C++, Java). It's obviously useful to know both. Then there's web-based languages (PHP, Flex) versus non-web-based languages. And there's …

Member Avatar for Nathaniel10
0
108
Member Avatar for emko

>> I got it to work with the arrays, but I can't figure out where to do the changes so that an vector can accomplish the same thing. ????????? This doesn't compile. In particular, lines 8, 18 and 37 don't match: The initialize function expects an array, but you give …

Member Avatar for emko
0
153
Member Avatar for harpay

Figure out how you do this in real life on pencil and paper and then turn the equations into code. You need to use the .90, .65, and .70 in some equation somewhere, right?

Member Avatar for nbaztec
0
582
Member Avatar for mrnutty

Nobody can force you to get "baked" and no one can force you to post when you are "baked". There are plenty of "crowds" out there that don't drink, smoke, or go out clubbing, and plenty that do. Now that you are an adult, you can pick your own crowd. …

Member Avatar for alan145
0
316
Member Avatar for VernonDozier

So I have opened a file with the "open" command and I get a file descriptor. That means I have to use lseek rather than fseek, which is fine by me. But what if I want to know how long the file is or what if I want to know …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for tylermlarson

a.out is the executable program's name when you don't specify a program name. You can't run an uncompiled C++ program. You can only run something that has been compiled into machine code. You compile with the g++ command. You start with a C++ program like you have done. Let's say …

Member Avatar for VernonDozier
0
118
Member Avatar for doomfrawen

First, you can use the "system" command", but it's generally frowned upon. Normally you use "execvp", execlp", or something similar, after forking, piping, or whatever. Use the Microsoft equivalent. The system command is doable, but keep in mind the lifetime of the process and where stdout goes, etc. The system …

Member Avatar for doomfrawen
0
677
Member Avatar for arntb0rnprgrmr

>> what should be the first step? The first step is to figure out exactly what you want. If you don't know exactly what you want because you don't know what's available, then the step before this step is as the last poster mentioned. Study Java Swing, particulary the Layout …

Member Avatar for VernonDozier
0
200
Member Avatar for Ancient Dragon

I don't see anything in the rules where it explains how/why to use code tags and other BB-Code correctly. That should be added IMO.

Member Avatar for Geekitygeek
0
157
Member Avatar for lonely_girl
Re: HELP

[QUOTE=lonely_girl;740635]Heyyy Thx alot!!! it worked without any errors but it was not giving any output....the output screen exits without giving output....[/QUOTE] Nick, Did you create the lonely_girl profile just so you could post your Mickey Mouse program and this response? Regardless, +rep to both of you, if there are two …

Member Avatar for Adak
0
256
Member Avatar for jelinky

Too many string here. A keys string and a grades string are sufficient. No need for all the substrings. Just do this: [code] if(key[i] == grades[i] { // right answer } else { // wrong answer. } [/code] You'll need at least an array of integers to keep track of …

Member Avatar for VernonDozier
0
190
Member Avatar for bmos31

Get the cout statement out of the do-while loop. If you want to display tempArray, do it after intToBinaryString has finished. A function should convert or display, but not both unless there is a reason IMO. Either use itoa or use a loop, but don't use itoa inside a loop. …

Member Avatar for prvnkmr449
0
180
Member Avatar for mrrko

[QUOTE=mrrko;687646]Someone?[/QUOTE] Please repost with code tags. Looks like at least part of your program got cut off. [noparse] [code] // paste code here [/code] [/noparse]

Member Avatar for Fbody
0
752
Member Avatar for exekiel101

You need to format your code. It is impossible to read. If this is a multiplication table, why do you want the user to input the cells? Values will be from 0 or 1 to numRows or numCols. Regardless, you create a dynamic 2-D array like this: [code] int numRows, …

Member Avatar for VernonDozier
0
78
Member Avatar for churva_churva

[QUOTE=churva_churva;1316554]sorry im just new here i dont know the rules[/QUOTE] Then READ the rules. They're right next to the logout button, at least some of them. Two possibly aren't there: [LIST=1] [*]One open thread per topic. [*]Don't PM people for help. Just post on the public forum. [/LIST] Read this …

Member Avatar for VernonDozier
-1
130
Member Avatar for John Sand

You have a file. You have variables that you have to read that file into. Your job is to write code that matches the file layout and the variables. getline and eof() are tools. Depending on the file layout, they may or may not be the right tools. If you …

Member Avatar for John Sand
0
174
Member Avatar for Bordeaux0113

The post count nickname formula list is deliberately not posted. They figure it would be too boring if everyone knew. But you could probably go through different members' post count along with the nicknames and quickly establish an accurate, though possibly not exact, post-count-to-nickname formula.

Member Avatar for NicAx64
0
188
Member Avatar for Vivek Venkatesh

[QUOTE=Vivek Venkatesh;1312640] Can anyone say me which one to use considering the fact that My Project should implement most of the Word Processing Features.....[/QUOTE] That's an AWFUL lot of features. Think of all of them: Let the user specify fonts, embed all sorts of graphics in the document, save in …

Member Avatar for VernonDozier
0
1K
Member Avatar for Chosen13

[QUOTE=Chosen13;1312948]Hello, Me and my development team are not sure how to get a users username/uid from their login on the website into the C++ application. I use PHP Cookies and Sessions for that. Is there anyway that this could work? Thanks.[/QUOTE] On the server side, you can use the "exec" …

Member Avatar for VernonDozier
0
284
Member Avatar for NewbyChic

Quotes are always nice too. But I think bloody_ninja had his tongue firmly in cheek with that post. Hence the :D avatar. Also let me be the first to point out that this thread started in 2005, then was revived in February, then again in April, then again today (I'm …

Member Avatar for javaAddict
0
178
Member Avatar for apple621

[QUOTE=apple621;1185010]Write a function whose prototype is string NumberToName(int x); that returns the string of english name of each digit of number x. Using this function, write a main program that reads a positive integer number and prints the english name of each digit of that number in a single line …

Member Avatar for programing
0
133
Member Avatar for King_Alucard

The vast majority of these errors: [quote] Error 1 error C3872: '0xa0': this character is not allowed in an identifier \\ilabss\home$\D03279277\Documents\Visual Studio 2005\Projects\Lab6Ex2\Lab6Ex2\Lab6Ex2.cpp 37 [/quote] have nothing to do with the code you posted. I just copied and pasted into Code Blocks and didn't get any of the '0x0a' errors. …

Member Avatar for VernonDozier
0
463
Member Avatar for GrimJack

It worries the heck out of me too. Anything that can be programmed to provide safety can be abused maliciously, particularly by the people who are "authorized" to develop/use the code. What if someone decides it would be a fun prank to turn all the traffic lights green at the …

Member Avatar for Agilemind
0
144
Member Avatar for gretty

I put in a lot of cout statements, like: [code] char c[3]; cout << "Got this far\n"; c[0] = 'H'; cout << "Now I'm this far! Cool.\n"; c[1] = 'e'; cout << "Hot damn! I'm this far\n"; c[2] = 'l'; cout << "Oh yeah! Stylin'. I'm here!\n"; c[3] = 'l'; …

Member Avatar for Dingbats
0
157
Member Avatar for Sugarskull

[code] System.out.println("firstVar is " + firstVar + \n"); [/code] You need an even number of quotes inside the parentheses. You're doing println, so it adds a newline character. Unless you want two of them, leave the '\n' off. firstVar probably needs to be converted to a string before adding it …

Member Avatar for Ezzaral
0
276
Member Avatar for babug

[QUOTE=cwarn23;1083498]I think the main problem here is that there are theories that contradict. Some of your theories contradict my theories and as I see evidence I choose which is best. However the main theory which is making this thread a mess is that everything on the periodic table is made …

Member Avatar for Sriman_Laxmi
0
1K
Member Avatar for happygeek

Does anyone but me not trust Michael Reagan to decide which of our e-mails (i.e. ALL of them) need to be automatically turned over to the FBI, CIA, NSA, etc. for "national security" reasons? They probably wouldn't even have to subpeona them. Michael Reagan would do a massive search for …

Member Avatar for ing
2
904
Member Avatar for new_programmer

[url]http://en.wikipedia.org/wiki/Reference_%28C%2B%2B%29#Relationship_to_pointers[/url]

Member Avatar for daviddoria
0
93
Member Avatar for ThrasherK

Line 41 - It looks to me like you have an "if" statement instead of a while statement when you are replacing the correctly-guessed letters. You need a while statement if you want to replace ALL the instances of a letter You also appear to be missing a closing bracket …

Member Avatar for VernonDozier
0
236
Member Avatar for bakizzy

[QUOTE=bakizzy;1297289]hi everybody!!! im new in developing systems using java.. i want to develop any system i need help. i dont know what to do. if you have any idea on what i can do please help..[/QUOTE] Way too vague. If you don't know Java at all, start with Hello World, …

Member Avatar for VernonDozier
-2
78
Member Avatar for Drakarus

[CODE=C++] struct Appoint { string place; string title; int hour, minute; int durationHr, durationMin; }; struct TreeNode { Appoint app; //The data in this node. Is this possible to put in here and use? TreeNode *left; //left subtree TreeNode * right; //right subtree TreeNode(Appoint temp) { //Constructor defined. Do i …

Member Avatar for Drakarus
0
281
Member Avatar for David_Omid

[QUOTE=David_Omid;1296558]Hey, sorry if this question is really really simple and silly to ask here but I can't find a suitable answer anywhere else and nobody out there so far is willing to help me out so any help would be greatly appreciated. Simple thing I want to do: I have …

Member Avatar for VernonDozier
0
111
Member Avatar for aakaashjois

[QUOTE=aakaashjois;1005006]hello guys, Can any of you help me create a game in java?? There has to be two paddles, one at the top and the other at the bottom. The paddles have to stop the ball from getting out of the screen. The ball cannot leave the screen from the …

Member Avatar for gauravk_bhanot
0
172
Member Avatar for qqwushi12345

[code] #include <stdafx.h> #include "genlib.h" #include "simpio.h" #include "math.h" int _tmain(int argc, _TCHAR* argv[]) { int i,nam,lim; for (i=50;1<=100;i++) nam=i; lim=sqrt((double)i)+1; for (i=50;i<=lim;i+=2) printf("%d",i); }[/code] Here is your code, with brackets and consistent indentation. [code] #include <stdafx.h> #include "genlib.h" #include "simpio.h" #include "math.h" int _tmain(int argc, _TCHAR* argv[]) { int …

Member Avatar for VernonDozier
0
2K
Member Avatar for goody11

Before you can control the other programs with your C program, you need to know if they are controllable and how to control them. If they are controllable by passing them command line arguments and running them and that's all you need, any command you can make from the command …

Member Avatar for goody11
0
215
Member Avatar for diafol
Re: Guns

[QUOTE=Ancient Dragon;1270502] Many people have been killed with knives, pitchforks, and all sorts of objects.[/QUOTE] But mostly with guns. [url]http://www.fbi.gov/ucr/cius_04/offenses_reported/violent_crime/murder.html[/url] [quote] Weapons Of those incidents in which the murder weapon was specified, [COLOR="Red"]70.3 percent of the homicides that occurred in 2004 were committed with firearms[/COLOR]. Of those, 77.9 percent involved …

Member Avatar for jon.kiparsky
0
661
Member Avatar for kulrik

[LIST=1] [*]Get the count [*]Calculate the sum [*]From the count and the sum, calculate the average. [*]From the average, get each deviation (error). [*]Square each deviation (squared error). [*]Add up the squares (sum of squared errors). [*]Divide by (count - 1) (mean squared error. count - 1 is degrees of …

Member Avatar for tong1
0
237
Member Avatar for Knightly

I agree that the first response to the thread was too severe. The OP of that thread, judging by his other threads, does not appear to be a "Give me teh codez" type of poster. That particular thread had a starting post that did not demonstrate effort, which doesn't mean …

Member Avatar for Knightly
1
662
Member Avatar for kbpszs

[code] if (code==1){ total += rv;} else { [COLOR="Red"]sumD += 1.0/rv;[/COLOR]} } if (code==2){ [COLOR="Red"]total += 1.0/(sumD);[/COLOR]} [/code] Both red lines of code execute when code == 2. Is this what you want?

Member Avatar for inoffice
0
5K
Member Avatar for ZlapX

To 1stDan, Voting and rep are entirely subjective. You can't find out who down-voted you, but you can find out who gave you bad rep by going to your control panel. Perhaps the person who down-voted you felt that you should have posted a specific link originally rather than just …

Member Avatar for ZlapX
0
147
Member Avatar for Rickay

[QUOTE=Rickay;1279718]Thank you, I actually figured that out about a minute after posting that hehe... but another question along those same lines if thats okay. How can I use an if statement to decide whether the input is a character or an integer? [CODE]if(x == char) //code here... if(x == int) …

Member Avatar for jonsca
0
135
Member Avatar for interist

[QUOTE=interist;1279702]Hello all, how can I pass some input from Java ti C++ using sockets. The input is only two int numbers. Any help with the sockets, please. I'm new but I need them.[/QUOTE] If you can pass info using sockets between two instances of a Java program and if you …

Member Avatar for VernonDozier
0
201

The End.