15,539 Topics

Member Avatar for
Member Avatar for sgriffiths

Hello I would like to count how many words are in a string ie "PETER JOHNSON LTD" so this string contains 3 I was going to use strtok but this is too slow. Any other ideas?

Member Avatar for jephthah
0
266
Member Avatar for iwanttolearnc

Good day to you guys! im having a bit of a problem using strtok. im currently tinkering with extracting gps data, which are separated by commas. ive seen code in several forums but most of them assign the output of strtok to the same char pointer. what i want to …

Member Avatar for jephthah
0
194
Member Avatar for speedy94519

Hey guys. So I basically read in a bunch of data from a file into a data structure. But while I was doing that I included the spaces (which I dont want). So now I want to compare each element to see if it does have a blank space, and …

Member Avatar for speedy94519
0
291
Member Avatar for Tellalca

I wonder why the following code work. In the debugger i see that every thing works fine but after the "root = createNode(item);" statement I can't see the new node assigned to root? [CODE]Node *insert( Node *root, int item ) { if(root==NULL) root = createNode(item); if(root->data>item) insert(root->left,item); else if(root->data<item) insert(root->right,item); …

Member Avatar for Tellalca
0
88
Member Avatar for Peter The Rock

i have this assignment due tommorow ive tryed it but it seems tuffer than what it should. anyone have any ideas? Write a function stage 1() that reads one of Tommy’s data files into a suitably declared and named data structure. You should assume that there will be at most …

Member Avatar for Aia
0
134
Member Avatar for simmi...

need help- create a tree(simple m-ary),with each node having 4 dataitems & 5 children. "IN C-language" just 1 example showing 1 or 2 node created will be really helpfull(as this is tedious)........i have all operation clear till binary tree...but this 1 is not clicking!!!!..... or in case u knw any …

Member Avatar for abhimanipal
0
148
Member Avatar for westsider123

I posted this thread but it got transferred to another, can someone edit the code for me so that I can get the answer in exponentiation, (^)and(*), Example : Enter number : 8 Prime factors of '8' : 2^3 Enter number : 56 Prime factors of '56' : 2^3*7 [B][U] …

Member Avatar for abhimanipal
0
102
Member Avatar for ellenski

My program is a very simple address book program. The program works but i don't know how to make it display the same names. Like for example, the name "Mark Lee", if there are more than one Mark Lee, i would like to display all of those Mark Lee w/ …

Member Avatar for kvprajapati
-4
296
Member Avatar for Narue

In answer to a coworker's question today about memory management today, I wrote the following code. It's an implementation of the gets function that accepts an infinite length string (bounded only by the heap) and [i]does not[/i] force the caller to free the resulting pointer. I figure that it's a …

Member Avatar for Narue
3
371
Member Avatar for james85

i have a problem when i use: [code] do { printf("press only A to continue):\n"); x=getchar(); }while(x!='A'); [/code] if i press anything the program prints me the message multiple times

Member Avatar for Aia
0
145
Member Avatar for oracle123

Hi all, I am using the following function which I found online to trim the leading and trailing whitespaces from a passed in string. It works fine for all the cases but I am having trouble in understanding the process being a newbie to C world. [CODE]char *trim (char *str) …

Member Avatar for Aia
0
741
Member Avatar for myth_terry

hello frns.. :icon_smile: i am in need of a code that does the following very very urgently.. please please help me !!! [CODE]read strings from a text file "text1.txt" (which are stored 1 per line without spaces) and store these strings in a string array A[]. then read strings from …

Member Avatar for myth_terry
-3
215
Member Avatar for kavourdoukos

How can i make sscanf() skip all whitespace characters?I read from a file and i dont know where are the characters. eg.->@Solomon Islands ,i need "Solomon Islands" in one string e.g->AGAF (AFT) – Afutara Airport – Afutara ,i need "Afutara Airport" in one string.

Member Avatar for Narue
0
7K
Member Avatar for javedkhan0258

I want to know how to read from a file. I have posted the first line of program.dat file before. There are more than one line in the file and i want to tokenize them and save them into different variables or pointers. Can anyone write full code how to …

Member Avatar for Aia
0
466
Member Avatar for MADHAN RISHE

can anyone help me for a simple polynomial addition using list.. no matter how long it is .. but it must be simple ...

Member Avatar for jephthah
0
177
Member Avatar for kavourdoukos

I would like to read a text file and store to strings some data that are important for me.I tried to do with strtok but wasnt successful?Can u help pls? [QUOTE]txtExample @Greece ASAS (FFF) - BLALAL BALLA BLALALAL - JAJAJAJAJ, XAKALXKAL ZMAH (AVK) – Arvaikheer Airport – Arvaikheer, Ovorkhangai ZMBH …

Member Avatar for abhimanipal
0
113
Member Avatar for dfetter88

Is there a systematic method to analyze the time complexity of a program strictly from output data such as run-time, the number of data swaps, data comparisons, etc? For example... [icode] Data Size | Run Time | Comparisons | Moves --------------------------------------------- 1000 | 0.00 | 15448 | 23965 10000 | …

Member Avatar for Banfa
0
117
Member Avatar for priyarao

hi i am doing code on single linked list in that i hav to save elements of my list to a file and then load it. The file is not loading pls check this code [CODE]#include<stdio.h> #include<stdlib.h> struct llist { int info; struct llist *next; }; typedef struct llist linked_list; …

Member Avatar for technology
0
118
Member Avatar for carrythe1

Hi, I am new to this website (and C++) so pls forgive any newb errors / convention mistakes. I have a project that contains both a normal source file (PB.cpp), associated header (PB.h) and a windows form (GUI.h). I'm trying to pass a variable from the form to a function …

Member Avatar for finito
0
165
Member Avatar for sdinu96

[code] #include<stdio.h> #include<stdlib.h> #include<string.h> struct name { int a; char b[10]; char c; }; int main() { struct name *p; char *n; n = (char *)malloc(3 * sizeof(char)); // in this why 3 means.. its my condition n = (char *)p; n->a = 3; // this line is showing error …

Member Avatar for Banfa
0
94
Member Avatar for anuragcoder

Hey guys, recently i've tried to compile this command line email program I get the error: cannot find -lobjc ld returned 1 exit status Here's my code. Any Help Appreciated. [CODE] #include <stdio.h> #include <stdlib.h> #include <string.h> #include <winsock.h> #define NETWORK_ERROR -1 #define NETWORK_OK 0 FILE *fp; char buffer[200000]; char …

Member Avatar for Aia
0
122
Member Avatar for mailsadiq
Member Avatar for bhosle

i have *.exe file which is written in C.....when i run this exe file, console window opens even though i have not given any thing to print on console...the .exe file performs file reading and writing operations....now how to i close the console window automatically....i dont want to hide....i am …

Member Avatar for chiwawa10
0
111
Member Avatar for javedkhan0258

I dont want to use strtok. I want to know how to use strsep? Any Idea. For example i have a string with delim progID|progTitle|progDescription|progCode. Help please

Member Avatar for jephthah
-1
155
Member Avatar for jskelly

I need to take 2 char strings (6 character date) (and (8 charachter operatror id) convert to uin32 to send over a bus to store by another processor. That processor later sends them back as uint32 and I need to conver back to char strings. Two files need access to …

Member Avatar for UncleLeroy
0
164
Member Avatar for karuppg

Hi All, I am using microsoft nmake tool version 6.00 for my project. when I make changes in any of the .h files, the C files which includes the header file is not getting compiled automatically. Can anyone give some suggestions please? Thanks in advance!! -Karuppiah

Member Avatar for Banfa
0
249
Member Avatar for ayushi agarwal

struct start { int* i; int* j; }p; p.i = new getValue(); when i am printing the value of i it is giving address not the value. Please tell how to get the value.

Member Avatar for jephthah
0
96
Member Avatar for mystb

Hi, I need to find p,q and e values for RSA. Here is a simple & short description of RSA. [QUOTE]Your enter a word (actually it is a sentence but for now a word) then program will convert letters to numbers (like a=1 m=13 etc.) and group them. Use with …

Member Avatar for abhimanipal
0
196
Member Avatar for ims@123

Hi... How can i call a c function for e.g say rounding decimals in Netezza.As it is possible in Netezza with a external C routine but don't the way to proceed.Can anyone please help me out.....??

Member Avatar for abhimanipal
0
67
Member Avatar for John A

Hi, I'm not sure if this is the right forum to post this thread in, but here it is. Even though I program on the Mac OS X platform, and am quite good at it, I'm really doing game programming, so I never really learned much Cocoa or Carbon. Can …

Member Avatar for jarimany
0
1K

The End.