Works like a charm ;) Thanks.
Type: Posts; User: Nephilim
Works like a charm ;) Thanks.
I'll try that, thanks. I'll post back.
I see. So would initializing c1 to zero do the trick?
I can't seem to successfully output characters with spaces. I inputted using getchar().
Any other ideas?
Thank you in advance!
printf ("Enter the Title [Use dots instead of spaces]: ");
...
How do you suggest removing them?
I meant with my original problem... this is the least of my problems now.
Only regarding TABLE_NAMES function please.
Thanks, that's helpful.
Any suggestions on that function?
I meant table_names... Fixed. So?
Greetings everyone!
I'm creating a phone book with lots of functions, and having problems with a few of them
Ok here is my code so far;
#include "ok.h"
#include <stdio.h>
#include <stdlib.h>...
Sorry for the late reply, I've been doing other programs as well.
Thanks for pointing out the mistake man, i'll study the code more. It seems the variables i and j confuse me most of the times, have...
You do realise this is a new request related to the original one in my 1st post, yet DIFFERENT?
So how could it have been solved in post 6 when I asked for it a few posts ago?
First I had to sort...
Just a part of this whole sorting algorithm. I sorted the points but i'm facing the same problem of associating their respective names. I made it work for 5-6 names as I told you before but past that...
Again, I'm a beginner. I'll try again.
I've been sitting on my laptop for 7 straight hours so excuse my blindness. I don't know.
tnum=punteggio[posMin];
punteggio[posMin]=punteggio[i];
punteggio[i]=tnum
for ( j = 0; j < cnum -1; j++){
posMin = j;
for (i = j+1; i < cnum; i++)
if (strcmp(cognome[i], cognome[posMin]) < 0)
posMin = i;
strcpy(tmp1,cognome[j]); ...
Yeah that didn't fix it. I wonder why.
I tried this also:
for ( i = 0; i <cnum; i++) {
for (j = i+1; j<cnum; j++) {
if(rank[i]>rank[j])
{
strcpy(tnome,nome[i]);
...
What's wrong with this code?
char tcognome[40];
char tnome[40];
int tnum;
int sorted[STRMAX];
int rank[STRMAX];
for (j = 0; j <cnum; ++j)
{
Thanks for replying :) So it looks like that's what I was missing. Works like a charm.
This is what i got:
for ( j = 0; j < cnum -1; j++){
posMin = j;
for (i = j+1; i < cnum; i++)
if (strcmp(cognome[i], cognome[posMin]) < 0)
posMin = i;
How can that be done? That's what I've been trying to do all the time.
I managed to sort the 3rd array of points but only if the points are entered in a descending order.
int j;
char tmp[20], tmp2[20];
int posMin, tmp3;
for (j=0; j<cnum-1;...
bithub, I realise that. As i said; I don't understand how can I associate to print out the first name and the points of that same array.
commontater, being new to C I would appreciate some...
Greetings everyone,
I am writing a program that allows the user to enter the first name, last name, and grade of each student. The program then sorts all the names alphabetically by last name, and...
That was stupid of me, thanks Salem!
Greetings everyone,
I cannot seem to output an array of strings after inputting it.
The user should input Names in each cell and then the names should be outputted.
The output should give the...