User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
DaniWeb is a massive community of 402,938 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,894 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Showing results 1 to 23 of 23
Search took 0.01 seconds.
Posts Made By: Sin-da-cat
Forum: C Nov 20th, 2006
Replies: 34
Views: 4,001
Posted By Sin-da-cat
Re: Is it possible to arange lines in a file alphabetically?

All the words have one CAP in the beginning and then all lowercase so I don't see how it matters. It's not like there are gonna be caps in the middle of words that will interrupt the comparing.
...
Forum: C Nov 20th, 2006
Replies: 34
Views: 4,001
Posted By Sin-da-cat
Re: Is it possible to arange lines in a file alphabetically?

I just got an infraction for saying '<snipped>' :lol: :lol: :lol: .I feel like Cartman in the South Park movie.

I posted my entire code a few posts above, and here is the file I was trying to sort...
Forum: C Nov 20th, 2006
Replies: 34
Views: 4,001
Posted By Sin-da-cat
Forum: C Nov 20th, 2006
Replies: 34
Views: 4,001
Posted By Sin-da-cat
Re: Is it possible to arange lines in a file alphabetically?

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define numofstr 50
#define strleng 101
int compare_ints(const void *,const void *);
main(){
FILE *a,*b;
char s[100]; ...
Forum: C Nov 20th, 2006
Replies: 34
Views: 4,001
Posted By Sin-da-cat
Re: Is it possible to arange lines in a file alphabetically?

I'm studying at an electrical engineering university. I don't have homework and I'm not trying to trick you. If you're gonna post I'd rather you tell me what's wrong with my code.:confused:
Forum: C Nov 20th, 2006
Replies: 34
Views: 4,001
Posted By Sin-da-cat
Re: Is it possible to arange lines in a file alphabetically?

I have studied the links and written a code that seems identical to the one in the 'solved example' page. Still, I'm getting a 'cannot convert 'int(*)(char *,char *)' to 'int(*)(const void *,const...
Forum: C Nov 20th, 2006
Replies: 34
Views: 4,001
Posted By Sin-da-cat
Re: Is it possible to arange lines in a file alphabetically?

Did that...works...tried to use qsort..getting a bunch of errors...losing temper.:(

Can you please just type the rest of the code for me? This isn't even part of my course, I just want to sort my...
Forum: C Nov 20th, 2006
Replies: 34
Views: 4,001
Posted By Sin-da-cat
Re: Is it possible to arange lines in a file alphabetically?

main(){
FILE *a,*b;
char s[100];
int i=0,k;
char starr[50][101]; /*50 - the number or strings I wanna put in the...
Forum: C Nov 20th, 2006
Replies: 34
Views: 4,001
Posted By Sin-da-cat
Re: Is it possible to arange lines in a file alphabetically?

Here comes another stupid question: how do you use qsort?
Forum: C Nov 20th, 2006
Replies: 34
Views: 4,001
Posted By Sin-da-cat
Re: Is it possible to arange lines in a file alphabetically?

<snip>, it was a stupid question.:rolleyes:

I know about Word not being a pure text editor, I was gonna paste it into a notepad file.

Thanks.
Forum: C Nov 20th, 2006
Replies: 34
Views: 4,001
Posted By Sin-da-cat
Re: Is it possible to arange lines in a file alphabetically?

This might sound stupid...but what is a container? Either it's an English word for something I'm familiar with (English isn't my first language) or I simply don't know what it is.

And please name...
Forum: C Nov 20th, 2006
Replies: 34
Views: 4,001
Posted By Sin-da-cat
Is it possible to arange lines in a file alphabetically?

OK, so the part of my course about files is over, but now I am wondering: if you have a file with, say, a bunch of names (each in its own line), is it possible to use "C" to make a new file with the...
Forum: C Nov 14th, 2006
Replies: 17
Views: 3,432
Posted By Sin-da-cat
Re: FILE + conversion from dec to hex = I need help

Ah, I see what you mean. Had to put a 'getchar()' after 'fclose' though so the black screen would stay open more than a milisecond.

Thanks for the answers.
Forum: C Nov 14th, 2006
Replies: 17
Views: 3,432
Posted By Sin-da-cat
Re: FILE + conversion from dec to hex = I need help

My thought: the while(fscanf... loop would go through the file line by line untill it gets to EOF, at which point it will stop. It works just fine in every program I write (including the one I...
Forum: C Nov 13th, 2006
Replies: 17
Views: 3,432
Posted By Sin-da-cat
Re: FILE + conversion from dec to hex = I need help

OK, nevermind, I figured it out. I threw out the function and just did the whole conversion from dec to hex in the body of 'fscanf' with local variables. I realized using a function was a completely...
Forum: C Nov 12th, 2006
Replies: 17
Views: 3,432
Posted By Sin-da-cat
Re: FILE + conversion from dec to hex = I need help

I'm not supposed to use any functions I'm not familiar with because I can't use them at my exam either. And my teacher never mentioned ssprintf, all I know out of that family is printf and fprintf.
...
Forum: C Nov 12th, 2006
Replies: 17
Views: 3,432
Posted By Sin-da-cat
Re: FILE + conversion from dec to hex = I need help

Yes, it's fairly obvious that can be used. Iguess my question wasn't very to-the-point. Here's what I got so far, and what I need from you:

#include <stdio.h>
#include <stdlib.h>
#include...
Forum: C Nov 12th, 2006
Replies: 17
Views: 3,432
Posted By Sin-da-cat
Re: FILE + conversion from dec to hex = I need help

C, not C++. Sorry, I should have said in the first place.
Forum: C Nov 11th, 2006
Replies: 17
Views: 3,432
Posted By Sin-da-cat
FILE + conversion from dec to hex = I need help

I'm pretty much new to using files, so I'm not sure if this is a banale question.

Here's the assignment: "Each line of the file dec.txt contains a whole number (>0). Write a program that creates a...
Forum: C Oct 30th, 2006
Replies: 11
Views: 5,515
Posted By Sin-da-cat
Re: Recursive function - checking for palindromes

I worked it out this morning by slightly altering my previous code and without using any functions I didn't use originally. I will get to know the functions you suggested as soon as I find the time...
Forum: C Oct 29th, 2006
Replies: 11
Views: 5,515
Posted By Sin-da-cat
Re: Recursive function - checking for palindromes

Ok, thanks very much. It's 22.50 PM here now so I'm too sleepy to think, but I'll definitely do my research tommorow and mark this solved if I understand everything.

P.S. Sorry about not using the...
Forum: C Oct 29th, 2006
Replies: 11
Views: 5,515
Posted By Sin-da-cat
Re: Recursive function - checking for palindromes

Alright, I used what you told me and made my own attempt, slightly different from what you suggested. Yet, my program always says the string is not a palindrome. Here's the code, can you see why it...
Forum: C Oct 29th, 2006
Replies: 11
Views: 5,515
Posted By Sin-da-cat
Recursive function - checking for palindromes

Can somebody help me with this? I'm not sure if this is the right forum section, so if it's not, please let me know. The problem goes like this:

I need to create a program that has a recursive...
Showing results 1 to 23 of 23

 
All times are GMT -4. The time now is 5:56 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC