Forum: C Nov 20th, 2006 |
| Replies: 34 Views: 5,831 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: 5,831 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... |
Forum: C Nov 20th, 2006 |
| Replies: 34 Views: 5,831 Nope. Still doesn't work. |
Forum: C Nov 20th, 2006 |
| Replies: 34 Views: 5,831 #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: 5,831 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: 5,831 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: 5,831 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: 5,831 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 array*/
a=fopen("C:\\C_fajlovi\\non_sorted.txt","r");... |
Forum: C Nov 20th, 2006 |
| Replies: 34 Views: 5,831 Here comes another stupid question: how do you use qsort? |
Forum: C Nov 20th, 2006 |
| Replies: 34 Views: 5,831 <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: 5,831 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: 5,831 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: 4,500 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: 4,500 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: 4,500 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: 4,500 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: 4,500 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: 4,500 C, not C++. Sorry, I should have said in the first place. |
Forum: C Nov 11th, 2006 |
| Replies: 17 Views: 4,500 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... |
Forum: C Oct 30th, 2006 |
| Replies: 11 Views: 9,678 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: 9,678 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... |
Forum: C Oct 29th, 2006 |
| Replies: 11 Views: 9,678 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: 9,678 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... |