Hi. I've declared a vector and now I want to add 1 to every spot in it that comes up from a random number generator. So if the number 6 came up I would want to increment vector[6] by 1. I have...
Type: Posts; User: PunkyBunny300
Hi. I've declared a vector and now I want to add 1 to every spot in it that comes up from a random number generator. So if the number 6 came up I would want to increment vector[6] by 1. I have...
Hi. I've declared a vector and now I want to add 1 to every spot in it that comes up from a random number generator. So if the number 6 came up I would want to increment vector[6] by 1. I have...
So I am trying to make a BST function that adds words from a .txt file. I want the function to add word, with the first letter as a sibling and all following letters as children. If a word has...
Hey. I"m trying to read a file of words into the array char* array[80] and I can't seem to make it work. I keep getting runtime errors when I use this:
char* word[80];
char str[80];
...
Hey. I have this class
class Railcar
{
private:
string cartype;
int ID;
int train;
public:
thats all the declarations before main.
This gives me an error about not recognizing railcar. What am I doing wrong?
//
#include <iostream>
#include <string>
#include <fstream>
#include <cmath>
#include <stack>
#include <ctime>
stuct words *ALL[50];
Is how words got defined! :)
THis isn't working! Help! =P
all = (words *) malloc(sizeof(words));
I get an error about the )!
and it looks just fine to me :(
I figured it out :)
I have a file that has some numbers in it that are in scientific notation. I need to read them in and then do some calculations with them. How would I go about doing this??
I've tried reading...
I added the code above. I am not familiar with perror but I assume that if that condition was true it would have reported that error during compiling. The program compiled fine and when I added...
Also, previously this:
fprintf (output, "%c", data[j]);
was in the place of:
fputc (data[j], output);
but that did not work either.
First off, thank you very much for the help!
There is an fprintf in the .c file. So it should be printing to that file right? Also, if I open the a.out file there's a bunch of unreadable stuff in...
I have this program that compiles and runs in microsoft C++ but when I try to compile with GNU either no output is produced or the output file is put somewhere and I don't know where it is! I am...
The read_integer function in the code below is weird. The first time the program runs through the loop it works just fine, taking in 2 integers and multiplying and adding them. However, if you...
#include<stdlib.h>
#include<stdio.h>
#include<malloc.h>
/*function prototypes*/
void get_choice(int *choice);
//void calculate_operation(int choice, int num, double largest, double smallest,...
:D Thanks so much! It finally works!!! Yay!
1 1 1 Abdelkhader El Mouaziz (31) NIKE, MAR 2:10:09 2:10:09 30:26 1:03:08 1:36:51 4:58
The stuff in bold is what I want to extract :)
Thanks :) I've tried using that... and maybe it's just that I'm tired... or maybe just that I am dumb (going for the former not the latter!) but I just can't get my program to scan up to the "(" and...
I'm trying to read in this list of data entries and then find particular parts of the entry out. I have been told that sscanf is what to use but am having absolutely no luck! I think part of the...
Alright, so if I use fgets how do I tell it to keep reading lines in until it reaches the end of file ?? I keep getting runtime errors if I put != EOF ... is != NULL equivalent??
Also, if I use...
:) It looks exactly like what I was trying to do... just so much cleaner! I'll try it out... Thanks!!!
I'm reading in very large numbers that may have unusual spacing... like 123 45 43657 4 And I need to store this number in an array of ints without all the spaces :) I'm really not very familiar...
It works! Yay!!! Thanks so much guys!!