Questions tagged [size]
The size tag has no usage guidance.
15 questions
0
votes
1
answer
343
views
CS50 Speller Size Function
My size function is not working and I don't understand why
unsigned int size(void)
{
int c = 0;
for (int i = 0; i < N; i++)
{
node *wNode = table[i];
while (wNode->...
1
vote
1
answer
157
views
pset5 /home/ubuntu/pset5/speller/speller.c:144: undefined reference to `size' By "undefined reference,"
// Implements a dictionary's functionality
include
include
include
include
include
include
include
include "dictionary.h"
const int HASHTABLE_SIZE = 65536;
typedef struct node
{
...
0
votes
0
answers
69
views
PSET 5 (speller): I don't know why I receive an inaccurate count for words in dictionary
unsigned int size(void)
{
int count = 0;
for (int i = 0; i < N; i++)
{
for(node *temp = table[i]; temp != NULL; temp = temp->next)
{
count++;
}
}
...
0
votes
1
answer
24
views
Pset4 Speller (Hash table) word count only fails in check50
All of the "WORDS IN DICTIONARY: " parts are resulting in "0"
but when i run the code on my computer trying both the "small" and "large" dictionary it seems to work perfectly. So what might be the ...
0
votes
1
answer
1k
views
CS50 pset4 speller size function
I managed to correctly write my speller using a hashtable, however the speller function did not return the correct number of words in dictionary so I had to take another method, but the question ...
1
vote
1
answer
698
views
array size in C
I have question regarding array size declaration in C. I see that if I declare an array in the main function without specifying its size like
int arr[];
arr[0] = 7;
arr[1]= 8;
it shows an error ...
0
votes
1
answer
243
views
Loaded use of undeclared identifier variable in size() function
In my size() function in dictionary.c, I am attempting to access the "loaded" boolean variable declared in main in speller.c, using the below code:
// Returns number of words in dictionary if loaded ...
0
votes
1
answer
57
views
pse5 ttrie less misspelled words and size not working
please help me figure out why am getting wrong mispelt words and 0 size.below is is my load , check and size:
bool load(const char *dictionary)
{
// TODO
FILE *fp=fopen(dictionary,"r");
if(fp==NULL)
{...
0
votes
2
answers
68
views
pset5 : word counter is giving out a number that is one more than the acutal words
I was woring on pset5 and I have been working with a small dictionary with just 71 words, when I check my own text files with 8 words all is working well except that it gives out number of words to be ...
0
votes
0
answers
240
views
crack.c brute force - optimization needed!
I have written a recursive algorithm that should break the encryption, although to do so, it creates a file for each possible size of a string (8 is max). After it depletes the 1 size combos, it ...
1
vote
1
answer
121
views
Why is int is of 4 bytes in CS 50?
While I was being taught C, it was said that the size of int datatype is 2 bytes. But in CS 50, I am being taught that it is of 4 bytes. Why is that so?
0
votes
1
answer
118
views
without changing the size the image is resized how ?
I haven't re-sized the new bitmap file but still i get an output which is same as large.bmp. I dont know how this work even if I haven't changed the size of image or the file
0
votes
2
answers
76
views
Font issues in Breakout
I cant find any specified fonts names, styles or samples to implement it inside setFont() can anyone help ?
0
votes
0
answers
2k
views
bmp image has unsupported header size
my program runs but large.bmp can't be displayed with error as "bmp image has unsupported header size".
Below the extract of my code that I think related to the error, please help see what's wrong ...
0
votes
2
answers
238
views
Pset6 "Size" giving the wrong output
I am counting one word too many every time my dictionary loads, what could be the cause?
I initialize the variable 'word_count' here:
bool load(const char* dictionary)
{
// Open the "dictionary"...