Thank you ZuK. That did work. I have another question in case you or someone else comes here. Would the following sample code be valid?
int a = -2147483648u;
printf("int [Minimum]: %d", a);
...
Type: Posts; User: Khaltazar
Thank you ZuK. That did work. I have another question in case you or someone else comes here. Would the following sample code be valid?
int a = -2147483648u;
printf("int [Minimum]: %d", a);
...
I have seen that unsigned int ranges from 0 to 4,294,967,295. I cannot print this to the user without a warning though. I'm just trying to understand the limits of variables, so this is just for my...
That's why I was confused. I figured it out by changing
A.set_name("First Last"), index);
to
c.set_name("First Last"), index);
Attention: I figured it out. I forgot to change A to be c instead when I was messing around with my classes.
I'm trying to figure out how to link classes by inheritance but I keep getting an...
When I try to convert the
string Name;
to
string Name[10];
Does anyone know why this will not display the name to the console? If I call A.getName(); in the addContact function itself it will retrieve the name correctly, however I believe it deletes itself...
I didn't mean it was better than the poster above me, I was replying to the original poster. I usually don't use quotes unless I am replying to someone other than the original poster.
A better example would be the following:
By better I am not saying better than Click_here's example, I am referring to the original poster's example.
#include <stdio.h>
int main(){
...
Could you show how that works? I have an idea, but I don't know if it would work with structures. Here is my guess:
#include <stdio.h>
#include <stdlib.h>
#define CONTACTS 50
typedef...
This is the correct use of realloc(), right? Thank you in advanced.
If there is a better way than declaring j, please let me know.
#include <stdio.h>
#include <stdlib.h>
#define CONTACTS...
Thank you everyone for your help. I changed my code to the following:
#include <stdio.h>
#include <stdlib.h>
#define CONTACTS 50
typedef struct {
char name[20];
The code below will compile just fine, I'm curious about some parts though.
1. About 50% of the time it will crash and give me the following error:
Process terminated with status -1073741819...