12 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for Pyler

So I'm trying to remove 2 brackets from lines I'm reading from a file. For some reason when I run my program the characters in between the delimeters is removed. for example `greetings pe()ple` would end up as `greetings pe` I'm using a char array of delimiters. `char delimiters[] = …

Member Avatar for Pyler
0
201
Member Avatar for Builder_1

the folllowing code i have made but its not catering for the vowels coming together...what should i do in this code to accurately count the number of vowels and count the remining char left in string without vowels as after tokenization only the first token remains in the char array/string …

Member Avatar for Builder_1
0
554
Member Avatar for smith32

Hi, Here is the File content. I want to use strtok to separate each. but the problem is if i use `strtok(string, "\",");`, the zip code (19428) of the detail is miss place and take State (PA) for the first record Because of "," in State. Although the second one …

Member Avatar for smith32
0
994
Member Avatar for aldrin_ison1

Hi! I'm new to C and I'm having some problems in my program. It opens a .txt file then copies this to another .txt file but replaces a certain word with another word. It uses command line arguments. Example: //inside text.txt love is patient love is kind ... ./change love …

Member Avatar for histrungalot
0
452
Member Avatar for shaunchu

So, I'm doing a test of strtok and my csv reader to fill an array of structs. Each line in the csv has a bunch of country information, and I'm only pulling the 2nd, 3rd, 8th, and 9th fields in each line to make the structs. My biggest problem at …

Member Avatar for shaunchu
0
173
Member Avatar for Lillylionhert
0
114
Member Avatar for Lillylionhert

I am working on a Priority Based Scheduler which reads the process in from a file. I have it reading from file and printing to the screen. I'm trying to use strtok to tokenize a line from the process test file and store it in three different arrays. The layout …

Member Avatar for Lillylionhert
0
4K
Member Avatar for asimnazeer

Hello All i am trying to compile a simple code for the strtok but getting the error as segmentation fault ( core dumped ) .. any help would be appreciated. [CODE] #include <stdio.h> #include <netinet/in.h> #include <stdlib.h> #include <string.h> main() { char *test="asim.nazeer.helo.me"; char *rsl=strtok(test,"."); //while(1) //{ printf("%s",rsl); //} } …

Member Avatar for asimnazeer
0
458
Member Avatar for mkab

Hello everyone. I have a problem using strtok in C. I get a user input from the command line and I want to tokenize it with pipe ("|") as the delimeter and put the result in a double pointer variable. Here's my code: [CODE]char** argv; char *token; token = strtok(userInput, …

Member Avatar for mkab
0
2K
Member Avatar for gkaykck

Hi I am trying to make my homework about a command line calculator, and i am trying to divide the entered string into small parts and i am trying to use strtok for this. [CODE] #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> struct var { char name[10]; double value; …

Member Avatar for gkaykck
0
590
Member Avatar for xenanovich

hi, this is something i keep running into. for example, in the following example of strtok, i'm splitting a given string on a space(" ") delimiter: [code] #include<stdio.h> #include<string.h> int main() { char str[]="1234563 34 7898"; char delim[]=" "; char* result=NULL; char new[15][3]; int i=0; int j=0; bzero(new, sizeof new); …

Member Avatar for xenanovich
0
178
Member Avatar for AdRock

I have got an example for cplusplus.com for converting a string into a char array so i can split in into tokens and adds to a vector and it works fine in the main method but if i try and create a separate function and pass a string as a …

Member Avatar for iamthwee
0
741

The End.