Roger, thanks for the help guys, as usual its greatly appreciated.
Hopefully in the near future I can shed light on topics myself :)
Type: Posts; User: Ryan Huddo
Roger, thanks for the help guys, as usual its greatly appreciated.
Hopefully in the near future I can shed light on topics myself :)
Yeah I have but I don't always understand it all - comes with learning.
for example, although I went through the link above but I am still not sure how to use usleep;
#include <unistd.h>...
Cheers mate, I will change the array around, I am just a bit confused with calling srand() once and then using the numbers generated to be assigned to an array without a loop (and in turn re-calling...
Jim:
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
I call a function that uses srand, but the function that is called multiple times in a loop while assigning an array, give me a sec I will post a simplified version to show you what I mean. Given...
Thanks, I tried this but I am obviously doing something wrong;
#include <unistd.h>
#include <stdio.h>
unsigned int usecs;
int main(void)
Hey guys,
Another simple question. I am generating random numbers using time.h, but obviously I need the time to elapse a small amount between each number generated to avoid the same number being...
Thank you, I knew there was something simple I was missing :)
for (int i = 0; i < strlen(argv[1]); i++) {
if (isalpha(k[i]))
{
}
else {
printf("Error 2\n");
return 1;
...
Yeah sorry i over looked I was using a #include file for GetString, migf1 is correct its from the CS50 CSE.
No worries I will thanks.
Again thanks, I will fix this.
I start the count at 1...
Just letting everyone know I figured it out, I don't completely understand it and if someone wants to explain it to me please feel free, but working code as follows;
int main(void){
string...
Ahhh, makes so much sense, haha learning curb. :)
Ah well that answers that issue, that brings me back to the first set of code i wrote, essentially:
// GetString
// for loop to find spaces
// - allocate spaces into an int
// use value to...
I don't mean to insult anyones intelligence because your all obviously good at this but regardless I will comment on lines to indicate my intent.
/*
When running this I am simply running it as...
I should add I am trying to use an unassigned array and it will only increase as required using the above code appose to using a loop to detect how many places I need to allocate the array......
*argv[x] = input[i + 1];
Am i wrong assuming I can use x to place the character in that position of the array?
x is declared earlier in the program and as you can see it increases by one if that...
This is doing my head in and I have been at it for hours. I have googled with no luck. tried different loops again no joy.
I have done what I need to do however without using an array, its messy...
Na I am to pro to read Tutorials, :P Kidding, thanks I will start reading post hitting the "post Quick Reply" button.
Thanks again, Ryan
While I have you here, could I please get some help with using structured recording with if statements?
No change to my other code however I am trying to use struct instead of individual char as...
AHHHHHHH
Thanks guys but I figured it out, dont understand it but it works..
getchar();
} if (keyWaterfeatures == 3) { printf("What is the name of the 1st key water feature?\n");...
To be honest I dont know what hhd is used for, the program I am using recommended it, when I was using %s it just crashed.
No error messages with the following;
char kwf1[20];
No input until this section whats so ever, the if statement determines how many 'Key water features' and then runs the appropriate lines based on the input (in this example its 3 obviously) and thats...
Hey guys,
I have a series of questions within an if statement. For what ever reason the very first fgets gets skipped.
if (keyWaterfeatures == 3) {
printf("What is the name of the...
Thanks, I didnt know that fgets did that but makes since, works how I intended now :)
Thanks again, Ryan
OR just simply not create a new line after each %s