im trying to store an integer with a string. The string has an associated integer used to reference the string. the integers and strings are read in from a file and are in random order. then they...
Type: Posts; User: ominub
im trying to store an integer with a string. The string has an associated integer used to reference the string. the integers and strings are read in from a file and are in random order. then they...
i've gotten this far, but i cant figure out how to store the smallest number while i compare it to the rest of the results.
the whole point is printing the rwo closest numbers so it will also have...
would anyone mind explaining how to do it?
yes, i realize that...
i have a sorted array of integers and i'm trying to find the two closest numbers. anyone have an idea of how to do this?
I've been working on this program for almost 3 weeks, but I can not figure out how to do it. Let me know if you can help.
i have to write a program using recursion to print a list of number...
thank you.
dont be a dick.
dammit! i looked at that line for hours and it never crossed my mind to do that. thank you!!!
wait what is gcc? im using bloodshed's dev-c++ compiler.
hasnt changed much but if i change what i need to it doesent compile
# include <stdio.h>
# include <string.h>
# define MAX_WORDS 20
what is it you want to be a 2D array?
using the mod operator only gives random numbers from 0 to the number "RANGE" its math(that i dont care about) that isnt worth knowing why, just that it...
possibly try this...
while ( strcmp(password,check)!=0 ) {
printf ("Wrong password. Try again.\a\n");
scanf("%s",check);
when using string compare, if you want to see if the...
ok great i changed that.
i also printed the result of the 2 fscanf's and a->num_words gives me the location... 8978688... NOT the 14 it should read. how do i get it use the number it reads. i...
anyone?
thanks, that was it. any idea about the rest?
OK. i think i got it. thank you for the help!
I'm having trouble with this program. it reads in a list of words from a text file and allows you to add words, search for words, compare 2 lists and print the list. the first line of the text file...
thanks for the detailed response. it really cleared everything up. its pretty interesting.
so let me make sure i got it all.
when you declare a pointer to a structure inside of a structure you...
wow. it seems really complicated. i think ill be able to figure it out after a little practice. what is the purpose of declaring a pointer like this?
struct foo {
int num;
char ...
i think i understand.
i only have 1 more question.
on the last 3 lines... when func3 prints a.num and a.word it prints "myotherword" then when the function ends and the printf in main prints...
well this code is made to confuse the reader. its a practice for my final exam and we are supposed to trace it and print its output. it serves absolutely no purpose other than that. also line 55...
consider the following code...
# include <stdio.h>
struct foo {
int num;
char *word;
struct foo *ptr;
well, shucks. thank you o' great one. i didnt ask you to write the program. i asked how to generate random numbers.
yeah, that didnt really help. i've looked at the FAQ's but i cant find anything on how to generate random #s between two numbers
im writing a program for practice that writes 1000 random words to an output file. the random words dont have to actual words just a bunch of lower case letters strung together in random lengths of 3...