Search Results

Showing results 1 to 12 of 12
Search took 0.01 seconds.
Search: Posts Made By: FC Jamison ; Forum: C and child forums
Forum: C Apr 1st, 2007
Replies: 1
Views: 1,844
Posted By FC Jamison
Last quarter our last assignment was to create two programs that gernerate silly sentences from words contained in a file.

I was able to create the program with a map, but have no idea how to do...
Forum: C Feb 28th, 2007
Replies: 3
Views: 4,206
Posted By FC Jamison
Yeah...like that.

I actually saw that in my research, but didn't think I could convert it to what I needed.

Your suggestion prompted me to look at the code a little closer, and I came up with...
Forum: C Feb 27th, 2007
Replies: 3
Views: 4,206
Posted By FC Jamison
I am trying to learn how to write a merge sort function, but I have only gotten so far with the book I am using now:


template <class T>
void mergeSort(vector<T>& s) { mergeHelper(s.begin(), 0,...
Forum: C Sep 20th, 2006
Replies: 11
Views: 6,635
Posted By FC Jamison
Could he use something like



static_cast<int>(string[0]) - 48
Forum: C Sep 20th, 2006
Replies: 11
Views: 6,635
Posted By FC Jamison
Correct me if I'm wrong...but doesn't atoi() require a C-String as the argument?


char input[20];

code...code...code...

atoi(input);
Forum: C Sep 18th, 2006
Replies: 4
Views: 2,016
Posted By FC Jamison
If you must use a double...for whatever reason...you can use


if (loanYears - static_cast<int>(loanYears) != 0)
Forum: C Sep 17th, 2006
Replies: 6
Views: 967
Posted By FC Jamison
You understood that, Salem?
Forum: C Aug 20th, 2006
Replies: 25
Views: 32,325
Posted By FC Jamison
I wasn't responding to DMR, I was responding to Salem.

DMR snuck that in while I was typing...lol.
Forum: C Aug 20th, 2006
Replies: 25
Views: 32,325
Posted By FC Jamison
I didn't resurrect it...I just answered t. Don't shoot the messenger.

If you have a better solution, share it.
Forum: C Aug 20th, 2006
Replies: 25
Views: 32,325
Posted By FC Jamison
/* atoi example */
#include <stdio.h>
#include <stdlib.h>

int main ()
{
int i;
char szInput [256];
printf ("Enter a number: ");
gets ( szInput );
Forum: C Aug 20th, 2006
Replies: 5
Views: 1,037
Posted By FC Jamison
Right off the bat I see 2 things...


if(c=getchar())!='\n')


should be


c == getchar();
Forum: C Aug 20th, 2006
Replies: 25
Views: 32,325
Posted By FC Jamison
Convert the string to a character array and then use atoi
Showing results 1 to 12 of 12

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC