Search:
Type: Posts; User: riechan
Search:
Search took 0.01 seconds.
-
September 28th, 2013, 07:48 AM
sorry, it seems to be working just fine. strcmp() returns a 0 when both character arrays are the same. :)
-
September 28th, 2013, 07:01 AM
Was wondering why strcmp() doesn't return true when comparing a string constant with a string that was acquired via a linked list. By the way, the data in the linked list was taken from a text file....
-
August 26th, 2013, 11:41 AM
Thanks, for that very detailed explanation 2kaud! Looks like I have a huge lot to learn about linked lists (among other things). I'll try to digest this for a while :)
-
August 26th, 2013, 11:00 AM
Wait, I tried doing this:
void cacheData(char a[60]){
...
strcpy(newNode->ACNM, a);
... }
-
August 26th, 2013, 08:22 AM
Yup, edited them. Thanks. :)
I have a question, this will possibly clear up all of my confusion in the crtNode(), or make it even more confusing for me (hopefully not). Taking your code as an...
-
August 26th, 2013, 03:35 AM
Questions/Clarifications:
while(curNode)
This is the same as while(curNode != NULL) right?
static struct Node *tail = NULL;
-
August 25th, 2013, 12:28 PM
@2kaud: Thanks for the hint... I tried doing it like this:
void crtNode(int val){
struct Node *newNode, *curNode;
// curNode must be initialized at start node
// because it will...
-
August 25th, 2013, 11:23 AM
Wait, sorry, let me see if I got this properly. In this code:
if(newNode != NULL){
newNode->Data = val; //save the data to current Data node
newNode->next = NULL; //point the next...
-
August 25th, 2013, 10:19 AM
I tried using the Debug and Watch in Turbo C (used start and val for the watched values) but it said undefined symbol on both instances. Then I tried using Watch on CodeBlocks but it doesn't look...
-
August 25th, 2013, 09:19 AM
But I did set start to NULL:
int main(){
int opt, val;
start = NULL;
...
-
August 25th, 2013, 06:17 AM
Hi guys, I'm trying to learn how to use Linked Lists. I was wondering if you guys can give me pointers here...
1. Freeing memory allocation - I don't understand the concept of free() that much. I...
-
August 17th, 2013, 08:14 AM
I see. Thanks for clearing that up 2kaud! :)
-
August 17th, 2013, 06:48 AM
Has anyone used CodeBlocks (MingW plugins) here? I can't seem to use the alloc.h library. When I try to compile my code, the compiler can't seem to find the alloc.h...
I tried compiling the...
-
August 9th, 2013, 05:55 AM
It's okay now. Solved it! I'm such a scatterbrain! hahaha
-
August 9th, 2013, 04:37 AM
scratch this post. i saw what the problem is. hahaha :D
-
August 8th, 2013, 08:44 AM
I was looking at this:
http://www.cplusplus.com/forum/general/39982/
And it said that system() is a non-standard function, and is OS-dependent (Windows). Is there any other way for us to run an...
-
August 8th, 2013, 06:59 AM
I know, that's why:
do {
printf("Please enter your name (50 characters max): ");
fflush(stdin);
fgets(nme, sizeof(nme), stdin);
printf("\nName: %s", nme);
-
August 8th, 2013, 04:03 AM
@SeventhStar: Before the fflush(), if the input is "Rie Ishida", it only got the "Rie" part and saves the "Ishida" part to the following scanf().
Cool! Thanks a lot! That fixed my problem with the...
-
August 7th, 2013, 10:43 PM
By code withdrawal, I mean, like certain functions not working at all (or being shunned/passed by the compiler). In the code below, I've been getting to make the fgets() work in Turbo C (running in...
-
July 31st, 2013, 11:30 AM
I suppose I'll be using long integer for the time being, since floating point numbers have been very erratic. But, I'll revise the data types once I finish coding everything. I'll follow up on you...
-
July 30th, 2013, 12:15 PM
@2kaud: Just made a couple of changes with the code. I used your test data and the results were all correct, surprisingly:
31641
I'm thinking it's because I used float instead of double? And in...
-
July 30th, 2013, 09:53 AM
I was told that using !feof() is a bad thing to do, so I guess I'll stick to my while statement? So the output is still the same. I really don't know what I'm doing wrong here, as to why the extra...
-
July 30th, 2013, 08:33 AM
@2kaud: Sorry, can you please explain this line:
if (char *nl = strrchr(acct.name, '\n')) *nl = 0;
I haven't used that many libraries yet, except for stdio/stdlib/math, so please excuse me. And...
-
July 30th, 2013, 08:04 AM
My output:
123456.70 <- strbal
Rie Ishida
1234567890
123456
123456.703125 <- acct.bal
The extra digits in the balance is back again.
-
July 30th, 2013, 07:02 AM
I might go for the fgets() route since I can't say if the account name consists of only two words or more. But what I want to know is why the data is not saved into acct's members...
|
Click Here to Expand Forum to Full Width
|