Just read your link. I suppose buffer overflows might just be the thing to ruin my day :D
-
I just switched to fgets(), Thanks
Type: Posts; User: Zalbik
Just read your link. I suppose buffer overflows might just be the thing to ruin my day :D
-
I just switched to fgets(), Thanks
Is there an equal command to gets() in C. I am storing a string into a character array and am using gets(). So I have something like:
char dBuffer[100];
gets(dBuffer);
I would just like to...
quzah
I really like the C++ ignore...oh well. As for the parameter combo:
scanf("%c*[^\n]*%c", &response );
I never would have thought that one up, thanks.
Yep, bitwise is the way to go...and here you go for 32-bit binary!!!
#include <stdio.h>
/*------------------------------------------------------------*/
/* Decimal to binary conversion */
...
Where did I go wrong with this code for my do while loop?
int main()
{
char response;
do
{
/* My main code would be here */
Grrrrrrr, I forgot about de-referencing.
As for why...because I couldn't remember how :p
Thanks for the help.
What am I messing up here? I am simply trying to enter a number as a dynamic float. I get the error:
error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'float...
I got.
I changed:
newNode = new ds_node;
newNode->data1 = data1;
newNode->next = NULL;
to this:
newNode = new ds_node;
Ok...I read up on it ; tried it; and have yet to figure it out. I read that you use the * operator to dereference the ptr. So I have been trying different versions of *data1; in different locations...
I'll give it a try
So all this program does is sort...at least some of the time.
If you look at Version 1, I DO NOT use a pointer in my structure as char data1. This version works just fine. Enter [q w e r t] and...
Actually the hiccup mention helped me out. Assuming this possible, I shut down the computer; Rebooted and now it works. Im guessing my playing with dynamic memory and not deallocating it killed my...
The following set of 3 files compile just fine when it is one program and I DO NOT use a class. When I broke it up into 3 files my compiler gets very angry with me.
The program sorts using linked...
Thanks...
It works through the code then when I get to the "Do you wish to continue with the Database" and hit yes it LOOPs forever. To me it looks like it should work back though the code and then ask "Do you...
Thanks I forgot about EOF. I did say I looked at it for way too long.
Solution change the for loop to while(inData.get() != EOF) and EOF found.
THX Hammer
This may be a simple problem to solve but I have spent way too much time on it.
If I am reading from a file and I have a structure array of size 100 but only enough data in the file to fill 3...
Could something like this be done in a the same program. Im trying to figure out why I cannot open a file I just wrote to. If it cannot be done then problem found. Or is this a big NO NO?
...
I have never done a typedef before. I'll try it out. It seems much easier to do it that way. Thanks.
Here, I'll do what I proboly should have done to begin with...I'll post the program. I suppose it is best to see just what I did. Maybe there is a better way of putting the data into the file for me...
I really went wrong with this one.
I have a .txt file with the contents:
1, 2, zz
1, 9, ccc
2, 3, lll
2, 13, aaaaa
3, 3, mmm
3, 11, oo
Hey that works...thanks
With this array I want to try and print only the characters ",2,3,4,5". My loop however first prints a bunch of junk and then will print ",2,3,4,5" so I take it that I am not doing it the correct way.
I give up and am asking for help here. Im playing around with arrays and trying to get characters from within the array.
int main()
{
char array[20] = "1,2,3,4,5,6,7,8,9,0";
char ch[20];...
I think I got! I'll be testing it when I get home.