Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
0 Endorsements
~12.4K People Reached
Favorite Forums
Favorite Tags
Member Avatar for mixelplik

I'm trying to read a keyboard entry into a 256 char buffer then extract from just the chars entered (trying to restrict it to just 8 characters) I am fundamentally not understanding how the #$%#$^ing char arrays work: #include <iostream> using namespace std; int main() { char buffer[256]; char pw[8]; …

Member Avatar for mixelplik
0
285
Member Avatar for mixelplik

OK, I've acheived HULK SMASH levels of frsutration with this one. I simply want to parse a date in the form of ##/##/#### The code below works peicemeal, ie each part SEEMS to work, but if I cout at the bottom the day is dissapearing or spitting out erroneous crap. …

Member Avatar for David W
0
200
Member Avatar for mixelplik

I'm parsing a date into three ints, then manipulating them. I then want to convert them back into strings so I can concactenate them with the slashes so I can search an array of dates saved in string format. I looked around and this code seems like it should work, …

Member Avatar for mixelplik
0
315
Member Avatar for mixelplik

I'm playing with all the cstring and string functions, getting familliar with how they work. Below I have a function call to strcata, and all I'm doing is declaring a string within the function, I'm not even using it with anything other than cout. Everytime I run the code it …

Member Avatar for DeanMSands3
0
192
Member Avatar for mixelplik

I'm tryin to search an array of structures for name. I'm comparing a char[] to a struct member with is a char[] my struct struct NBA_Team { char* name; char conference[8]; char division[10]; unsigned short wins = 0; unsigned short losses = 0; float pct; }; My search code void …

Member Avatar for rubberman
0
173
Member Avatar for mixelplik

I'm practicing my parsing, and I'm writing a program with an overloaded function that counts the words in a user entered cstring and regular string. Suprisingly the cstring was easy peasey but the string object is has me a stumped. I don't think my cstring was the most efficient solution, …

Member Avatar for mixelplik
0
324
Member Avatar for mixelplik

This code is supposed to randomly assign numbers to an array of structs, but isn't working at all. I have no clue why, everything looks fine to me, can some one take a look and tell me why it's crapping out on me? #include <iostream> #include <cmath> #include <cstdlib> #include …

Member Avatar for mixelplik
0
98
Member Avatar for mixelplik

I have no clue why this search isn't working. Two majors problems (1) As is it always returns false (2) It would recognize valid IDs if instead of setting found to true, I just returned true, but I don't want to do it like that, and if there was an …

Member Avatar for rubberman
1
120
Member Avatar for mixelplik

I'm trying to scroll through a list of cstrings and if they end in an 's' I want to replace it with a '\0' the problem is somtimes it catches the word and corrects it for a comparison, but other times it doesn't while (ptr != NULL) { if(ptr[sizeof(ptr)] == …

Member Avatar for vmanes
0
129
Member Avatar for mixelplik

Can someone explain this line a bit for me, I get the big picture, but the under-the-hood aspects are eluding me. testFile.getline(buffer, sizeof(buffer)); I have a char array buffer of size 80. Get line extracts a line from my testFile, and puts it into the buffer. When I "cout" the …

Member Avatar for Ancient Dragon
0
122
Member Avatar for mixelplik

I'm reading a file in line by line. At the end of the file there wackily are to carriage returns. I'm reading the lines in like this (code below) then parsing them. Because there are two wonderful returns the wonderful program crashes everytime I run it. char* ptr; ptr = …

Member Avatar for Lucaci Andrew
0
185
Member Avatar for mixelplik

I'm trying to parse an input file line by line. I want to grab each line one at a time, put it into a null terminated char array. I can't seem to do it. I tried something like this and just got weird ass results. int q = 0; do …

Member Avatar for Ancient Dragon
0
4K
Member Avatar for mixelplik

I'm trying to search for a word in an array of strings, everytime it gets to the while loop it just loops infinitely. It's getting the words and comparing just that when it gets to the second else, It just takes a fat dump. Can anyone help? So damn frustrating. …

Member Avatar for mixelplik
0
138
Member Avatar for mixelplik

I'm just trying to scroll through a input file, fin is the object name and it goes into an infinite loop. I'm using this check !fin.eof what am I missing or not understanding? #include <iostream> #include <fstream> #include <cctype> #include <cstdlib> #include <string> using namespace std; // ------ PROTOTYPES --------------------------------------------- …

Member Avatar for jamesjvj
0
162
Member Avatar for mixelplik

I'm trying to run a binary sort that sorts through a list of randomly generated numbers, but for some reason isn't working. It will usually tell me if the highest or lowest numbers are in the array, but acts like a spaz on the middle ones. I keep fiddling with …

Member Avatar for vmanes
0
190
Member Avatar for mixelplik

I need to generate 40 random numbers between 50 and 100 using rand(). How do I do this? cout << sizeof(a) << endl; for(int i = 0; i < 40; i++) { if(rand() % 1000+1 >= 50 && rand() %1000+1 <= 100) a[i] = rand() %1000+1; } I was doing …

Member Avatar for Moschops
0
654
Member Avatar for mixelplik

How do I pass a single row of a 2 dimensionsl aarray to a function? #include <iostream> #include <iomanip> #include <fstream> #include <cstdlib> using namespace std; // ------ Prototypes ------------------------------------------------------ double calcNums(double[]); // ****** MAIN ************************************************************ int main() { double nums[2][5] = {1,2,3,4,5,6,7,8,9,10}; calcNums(nums[1][5]); return 0; } double calcNums(double nums[1][5]) …

Member Avatar for mixelplik
0
660
Member Avatar for mixelplik

I was writing a program that opens a file assigns each element to an array. I was wondering if anyone had suggestions on how to get the number of items in a file, without knowing before hand. I was usuing this: int main() { ifstream inputFile; inputFile.open("P6.txt"); int index = …

Member Avatar for Ancient Dragon
0
331
Member Avatar for mixelplik

I want to pass an input file to a function and within the function, fill an array by reference. It isn't allowing me to do this, it keeps telling me it's expecting a ";" after i in the function. I couldn't really find anything about this in my book - …

Member Avatar for mixelplik
0
260
Member Avatar for mixelplik

I'm practicing arrrays and in the following program I'm passing a multidimensional array to a function to fill it. This worked with a single dimensional array just fine. (1) Is this bad practice? (2) Do the multi-D arrays work the same way as the regular ones. In the program below …

Member Avatar for mixelplik
0
210
Member Avatar for mixelplik

#include <iostream> #include <iomanip> using namespace std; int main() { cout << "\n0----------------------1------8\n"; cout << setw(22) << left << "Registration Fee "; cout << setw(8) << right << fixed << setprecision(2) << "$ " << 22.0 << endl; cout << setw(22) << left << "Hotel Total "; cout << setw(8) …

Member Avatar for mixelplik
0
186
Member Avatar for mixelplik

I'm trying to get a better understanding of ifstream, and was playing with it using the program below. It's purpose was to grab the first and last entries in the file, instead I get some perplexing output leading me to realize I've very little clue as to how streams really …

Member Avatar for mixelplik
0
1K
Member Avatar for mixelplik

I see a lot of people list code using this "::" as in: #include <iostream> int main() { std::cout << "Blah, blah, blah"; return 0; } and others use "using" #include <iostream> using namespace std; int main() { cout << "Blah, blah, blah"; return 0; } Is there a downside …

Member Avatar for mixelplik
0
262
Member Avatar for mixelplik

My while loop should terminate when the user types 0 for employee number. Unfortunately when you press 0 the loops iterates at least once before terminating. I was under the impression that as soon as the sentinal value is triggered the loop would terminate immediately. Right now I run program …

Member Avatar for mike_2000_17
0
144
Member Avatar for mixelplik

I was working on a praxctice program and wanted some numbers fixed dollar amounts to 2 decimal places while others to be displayed as plain old ints. I used this code, but noticed that now ALL numbers are set as fixed 2 place decimals. Is this how fixed and setprecisioun …

Member Avatar for mixelplik
0
131
Member Avatar for mixelplik

Hi, I'm trying to send an array of data to a .txt file, and after a couple days am just rewriting code I wrote days ago. I have an array of ints that I want to send to file in three columns outputFile.open("sorted.txt"); for(int i = 0; i < size; …

Member Avatar for L7Sqr
0
422
Member Avatar for mixelplik

How can I loop through a data field with a binary search, looking for multiple values? Please, I don't want to know another, more efficient way, I want to do it this way to understand the concepts. Also my data is indeed sorted before the call is made. The data …

Member Avatar for mixelplik
0
1K
Member Avatar for mixelplik

Please, I know this is a simple question. I'm copying this code out of my text book, almost ver-mother#&$(ing-batm And it mother#&$(ing refueses, REFUSES to open the mother#&$(ing file and write to the mother#&$(ing array. WTF - Sorry for the language, but this is so stupid and silly and I …

Member Avatar for mixelplik
0
188
Member Avatar for mixelplik

I'm still very new to C#, but have some experience with scripting languages such as javaScript, PHP, and VB.Net. My question is how do I call a method from another method? Below is a chunk of code from my program. I want this method to evaluate a value and two …

Member Avatar for Geekitygeek
0
116
Member Avatar for mixelplik

Ok, I thought I was clear on the double, int, float, decimal etc types. I used typed variables in VB and was comfortable with them. I've just started C# and out of the gate I feel totally clueless. I keep assigning double type variables expressions with division and when I …

Member Avatar for mixelplik
0
194