Forum: C++
Mar 5th, 2009, 8:16 PM
|
|
Replies: 7
Views: 1,547
Re: How to make this simple program repeat?
There's multiple types of loops in C++, the most common are for loops, and while loops.
For loops are mostly used when a counter is involved:
for (int i = 0; i < 10; i++)
{
//do stuff here. This...
|
Forum: Coder's Corner Lounge
Mar 1st, 2009, 12:51 PM
|
|
Replies: 72
Views: 2,227
|
Forum: C++
Mar 1st, 2009, 7:46 AM
|
|
Replies: 2
Views: 191
|
Forum: C#
Feb 21st, 2009, 4:58 PM
|
|
Replies: 12
Views: 2,834
Re: Using the StreamReader Class
Multiple things that you're doing wrong:
- If you need to access a single character in a scring, use a subscript. (e.g myString[3])
- If you're looking for a specific character in a string, use...
|
Forum: C#
Feb 21st, 2009, 2:39 PM
|
|
Replies: 12
Views: 2,834
Re: Using the StreamReader Class
For starters, you're reading the line twice: once inside the while condition, and again inside the loop itself. So you're only reading every other line
|
Forum: C#
Feb 20th, 2009, 5:56 PM
|
|
Replies: 12
Views: 2,834
Re: Using the StreamReader Class
Here's a parser I wrote to extract specific values from an html webpage, as a part of a larger project. Enjoy.
using System;
using System.Collections.Generic;
using System.Linq;
using...
|
Forum: C#
Feb 19th, 2009, 4:44 PM
|
|
Replies: 12
Views: 2,834
Re: Using the StreamReader Class
You can read the first line to a string and .split() it into a string[] array, then return the string[0]. Can you post the code you have so far (to read the file)?
|
Forum: C++
Feb 13th, 2009, 6:21 PM
|
|
Replies: 6
Views: 610
|
Forum: Community Introductions
Feb 10th, 2009, 5:39 PM
|
|
Replies: 19
Views: 1,535
|
Forum: C++
Feb 6th, 2009, 5:36 PM
|
|
Replies: 20
Views: 1,287
|
Forum: C
Feb 5th, 2009, 10:10 PM
|
|
Replies: 6
Views: 402
Re: guys, kindly check my program...
Ah typedef, I see now. I use it to define easier struct names usually, but I would much rather see the * next to every pointer definition. You're right though, there is no efficiency gains from my...
|
Forum: C
Feb 5th, 2009, 4:59 PM
|
|
Replies: 6
Views: 402
Re: guys, kindly check my program...
Well, you got the list mostly working. Now when you go to display a number in display(), make sure it is even:
if (p->x % 2 ==0) //only print even numbers
printf("%d\n",p->x);
p =...
|
Forum: C
Feb 2nd, 2009, 4:57 PM
|
|
Replies: 16
Views: 924
Re: scan a string from right to left
You can either use a dual counter for loop,
int i, rigthLim=strlen(str) - 1;
for (i = rightLim - 1, j= 0; i >= 0; i--, j++)
{
temp[j] = str[i];
}
or calculate the index on the fly
int i,...
|
Forum: C++
Feb 2nd, 2009, 7:11 AM
|
|
Replies: 20
Views: 1,287
Re: Need help from C++ experts
Ultimately, an ID card reader would be best because it minimizes fraud and human error. However, since you're dropping this option, I would switch to an Employee ID number (5 digits, assuming a small...
|
Forum: Coder's Corner Lounge
Feb 1st, 2009, 9:28 PM
|
|
Replies: 6
Views: 361
|
Forum: C#
Jan 31st, 2009, 8:05 PM
|
|
Replies: 9
Views: 793
Re: var type
What do you mean by var type? are you talking about 'object' ?
|
Forum: Project Ideas
Jan 29th, 2009, 6:06 PM
|
|
Replies: 5
Views: 601
Re: a program idea
You don't lay out clear specification. How would a button "appear" on a website? why would you use another website to send an SMS? and why would you want to do this in bash script? The last point...
|
Forum: Visual Basic
Jan 28th, 2009, 5:21 PM
|
|
Replies: 7
Views: 1,827
Re: VB6 If-Then-Else Condition Question
For those, like me, who hate downloading files to look at code, here's the content of the pdf:
If "TorF" = "True" Then
Worksheets("Wrk Accum Table").Range("here").Select
Selection.ClearContents
...
|
Forum: C++
Jan 28th, 2009, 8:31 AM
|
|
Replies: 8
Views: 513
|
Forum: C#
Jan 27th, 2009, 6:40 PM
|
|
Replies: 2
Views: 4,943
Re: C# Programming for the iPhone
Actually you don't have to pay for the Apple Dev member to put an app on your iPhone. You can test it on up to 100 phones, but once you want to go App store, you have to pay up. Also, you don't need...
|
Forum: Visual Basic .NET
Jan 26th, 2009, 4:26 PM
|
|
Replies: 26
Views: 1,271
Re: try - catch statements
You successfully fooled me into reading a two years old thread. Sure seeing a post by 'Arevos' should've hinted to the age of the thread, but I guess I can't miss out on endless arguments.
|
Forum: C#
Jan 26th, 2009, 7:02 AM
|
|
Replies: 1
Views: 2,332
Re: Resizing windows form controls
Play around with the Anchor property of .NET controls. If you set it to "Top, Bottom" the control will resize vertically. If you set it to "Top, Bottom, Left, Right" the control will resize in every...
|
Forum: C++
Jan 25th, 2009, 11:05 AM
|
|
Replies: 8
Views: 459
Re: can u help me!!
Yes I can, but I won't. If you started writing this, and showed some effort, then we will help you.
|
Forum: C++
Jan 25th, 2009, 9:58 AM
|
|
Replies: 8
Views: 513
|
Forum: C
Jan 24th, 2009, 12:58 PM
|
|
Replies: 8
Views: 512
Re: Linking error
Here's a step by step on how I got it to work:
- Open VS 2008 and create a new project by selecting Other Languages->Visual C++->General->Empty Project
- In you new project, the Solution Explorer...
|
Forum: C
Jan 24th, 2009, 11:59 AM
|
|
Replies: 8
Views: 512
Re: Linking error
Show us your header file code, and the code where you include it, and the actual linker error. Maybe we can help you better then.
|
Forum: C++
Jan 24th, 2009, 11:52 AM
|
|
Replies: 19
Views: 1,396
|
Forum: C++
Jan 24th, 2009, 7:15 AM
|
|
Replies: 19
Views: 1,396
Re: What are colons used for?
Colons in C++ can also be used for inheritance and to indicate access modifiers in class:
#include <iostream>
#include <string>
using namespace std;
class Word
{
public: //access modifier (public,...
|
Forum: JavaScript and Client-Side Browser Scripting
Jan 23rd, 2009, 7:01 AM
|
|
Replies: 1
Views: 379
Re: Firefox Temporary Lockup
Looks like these guys had this discussion before (http://www.ozzu.com/programming-forum/javascript-sleep-function-t66049.html). It appears the solution is to use he setTimeout()...
|
Forum: Other Programming Languages
Jan 22nd, 2009, 5:05 PM
|
|
Replies: 5
Views: 829
Re: Cobol numbers question
I have working production code that moves a PIC S9(09)V99 COMP-3 number to PIC 999999999v99 for display purposes. It takes simply drops the sign because the picture of the receiving field is not...
|
Forum: C#
Jan 22nd, 2009, 4:47 PM
|
|
Replies: 2
Views: 431
Re: Database with C#
Your question is ambiguous.
Are you inquiring about how to make a search function?
In this case, given that you had to deal with 36 queries already, making a search function would not be difficult...
|
Forum: Other Programming Languages
Jan 22nd, 2009, 10:43 AM
|
|
Replies: 5
Views: 829
Re: Cobol numbers question
I believe if you move it to an unsigned field(from a PIC S9(9) field to PIC 9(9)), Cobol will convert it for you
|
Forum: C++
Jan 21st, 2009, 4:56 PM
|
|
Replies: 7
Views: 344
Re: Need help with looping password input 3 times.
Here's one way to do it. Put the password check code in a function, and call that function 3 times or until you get a correct password.
There are other ways to do it, and many shortcuts to take. But...
|
Forum: C++
Jan 21st, 2009, 6:31 AM
|
|
Replies: 9
Views: 578
Re: C++ related problem
@Chris: you are missing the point of a static variable. You should NOT set it in the constructor because it should NOT vary by instance. It would stay constant across all instances of the class....
|
Forum: Java
Jan 20th, 2009, 8:20 PM
|
|
Replies: 7
Views: 500
Re: Multiple Objects being drawn simultaneously
Almost everything in your class is defined as 'static'. Those variable are class variables, not object variables. In other words, they will not be copied for every object, but will stay static across...
|
Forum: Coder's Corner Lounge
Jan 20th, 2009, 8:11 PM
|
|
Replies: 43
Views: 1,856
Re: Spam on PFO
I completely agree, especially with the third option. And if it is not possible for new members only, turn off picture posting all together for the time being. How often do we legitimately need to...
|
Forum: Show Off Your Open Source Projects
Jan 20th, 2009, 8:04 PM
|
|
Replies: 9
Views: 617
|
Forum: Community Introductions
Jan 20th, 2009, 7:57 PM
|
|
Replies: 12
Views: 652
Re: Being me the only way I know how
@google_girl: welcome to PFO. I see you have great enthusiasm for programming, but taking in so many languages in record time might not be a healthy approach. However, it differs from individual to...
|
Forum: C
Jan 18th, 2009, 10:39 AM
|
|
Replies: 3
Views: 347
Re: Can you help me with this code?
Here's some tips on making your program easier to look at and debug:
1 - Structure: object code is for computers, but source code is for people. So make sure it is readable by humans by using proper...
|
Forum: Java
Jan 17th, 2009, 9:24 PM
|
|
Replies: 12
Views: 496
|