Problem resolved. Resolution: inadequate specification of constructors.
Type: Posts; User: Kayl669
Problem resolved. Resolution: inadequate specification of constructors.
I can't figure out what's wrong with my + function. 'my_string temp' doesn't appear to be assigning a memory address to temp.s or the correct value to temp.len and so the terminates with an error....
Thanks for your help both!
My string array 'wordbank' is empty after my getword function has run. Please could somebody tell me what I need to know about strings to understand why what I'm trying won't work. Thanks
...
Thanks Salem. This one threw me because the error appeared immediately after stepping out of strstr. I expected to step through more code before getting this error. Any idea why gdb skips stepping...
When I run gdb and set my args and step through to identify what is causing the problem I get a segmentation error on line 17 :
'if (strstr(*argv, "./")) {'
However, if I comment out from below...
I knew it would be something stupid on my part. I just couldn't see it
I'm getting a segmentation fault on the '*val = atof(*argv);' line but can't understand what's going on. I want this piece of code to put numeric command line arguments in the val array. What's the...
Oh I See! Thanks for your help
It's nice that you're getting the right output Syscal...any ideas why I might not be?
Thanks for your responses.
#include <stdio.h>
#define ARRSIZE 200
void itoa(signed char, char[]);
void reverse(char[]);
int main(void) {
signed char num = -127;
char string[ARRSIZE];
Thank you for your help. I got there in the end. One of the problems was that I didn't realise that the higher order bits ignored in calculating next wouldn't affect the result of the following...
Thanks for your help both.
How is this code processed then, such that the function 'next' doesn't exceed its limit? How are upper bits lost and the calculation still successfully made?
:)
In the following code I'm not sure how the rand function operates successfully, given that the unsigned long int variable 'next' appears to exceed that variable type's limit of 4294967295 (Thanks for...
Hi,
I've produced some code (some of which is below) that contains a segmentation error on line 87 ("ascii[d] = '\0';" in my htoi function). I'm creating a function to convert a hexdecimal string...
Ok I've got a lot of new stuff to learn here! Thanks for your help.
Thanks laserlight. Although can you give me an example as I'm not very knowledgeable about in-built functionality. Also I think CHAR_BIT is part of the limits header and my exercise tells me I should...
Actually I spose you wouldn't use char variables in a printf context...that's more putchar()
Thanks for your help both. Can I confirm with you that in a printf context %d is used for signed ints and %u for unsigned ints... What about unsigned chars too?
MK, I kinda get Two's complement...
Thanks! I got this as an output:
Value of 'a' is: -1
Value of 'b' is: 65535
Value of 'c' is: 255
Value of 'd' is: -1.0000000
from
#include <stdio.h>
Exercise 2-1: Write a program to determine the ranges of char, short, int, and long variables, both signed and unsigned, by printing appropriate values from standard headers and by direct...
OK. Thanks all. Very helpful. Dino I've sorted my mistype thanks for pointing it out.
Hi again,
I'm using the GNU GCC compiler. Everything is as default because I'm very new to all this. Is GDB a compiler?
Thanks
Thanks laserlight; that's resolved the issue! Is there someway I can query my <stdio.h> to see what functions it contains?
Thanks for your suggestion Epy, although, I've implemented it (see below) and still get the same problem:
#include <stdio.h>
# define MAXLINE 1000
int getline(char[], int);
void copy(char...