I came here because this place seems to have the most knowledgeable programmers on the internet :)
My question is: In java if everything is essentially an object (aside from primitive data types),...
Type: Posts; User: new2C-
I came here because this place seems to have the most knowledgeable programmers on the internet :)
My question is: In java if everything is essentially an object (aside from primitive data types),...
Thank you all for your input.
Seems to work for me. What input are you using?
Are there any other jobs/applications that C attributes to. Something other than embedded systems.
I would like to go into embedded systems because I enjoy this language but I feel that being an...
It frees the memory what the pointer was pointing to. As long as the memory was allocated dynamically.
You will have to parse the string. Anytime you come across an character that is an int, add it to a string. Then you can use atoi() function to convert it to an integer. That should get you started....
I can't argue with that. It just seems that when I hear about "Bad Programmers" it's in the workplace.
I have read many articles online about the software engineering workplace and how bad programmers can be. What does that typically mean? I imagine it as being someone who uses ill practices like...
while(ch != 'Q' || ch !='q');
need to be an AND statement
while(ch != 'Q' && ch !='q');
Make sure you always check for null in your looping conditions, this will make sure that you do not access any invalid memory locations.
ex.
for(curr;curr!=null;curr=curr->next)
you can add...
I believe so, yes.
x = fscanf(fp,"%s", &x);//x should be of type int, and the &x should be a string
//for example
int x,status;
char array[256];
x = fscanf(fp,"%s", array)
All you are doing is printing out the file name, you arent printing anything out from the file itself. I think you are experiencing some undefined behavior.
Your fscanf is reading a string but only storing it in a char, (x). You should have a string to store the values.
x should be of type int I believe, EOF is int.
What does the file look like?
I have a file that has 70k words in it. I am trying to determine how big my hashtable should be, I suspect it should be 75 to 80% of the file size (ex. 70000 x .75) If I make it that size, what sort...
Why do most C examples pass a double pointer when manipulating linkedlists? Why can not we just pass a single pointer to the struct?
I think using an external reference accessor for a linked list...
void foo()
{
int a, b, i;
scanf("%d", &a);
scanf("%d", &b);
while (a != b)
{
if(a<b)
for (i = a; i <= b; i += 1)
printf("%d ", i);
Let me guess, you are using Bloodshed Dev-C++...
^TITLE
I want to be something special and will dedicate myself to becoming an expert in the hardest most sought after (by employers) job.
I just want to be worth something in the world, no pity...
int main(int argc, const char * argv[]) //remove the const key word
if (scanf("%s", &in_name) != 1) //%s is used for strings, %c is used for char
Sizeof(words) returns the size of the pointer not the actual length of the array, I believe. You should pass in the length of your arrays into the function parameters.
I was thinking it did due to the name. I noticed in the prototype it takes an int parameter, I also noticed the examples in main have some parameters passed as a char, shouldn't that create some...
Does putchar automatically cast the int to a char?
int c;
while ((c = fgetc(fp)) != EOF)
{
putchar (c);
}
Laserlight, will this book give me a good grasp on the "Standard" and underlying layer of abstraction?