7 Discussion / Question Topics

Remove Filter
Member Avatar for
Member Avatar for kouty

I dont understand the appearent discrepency in the treatment of the variabe x, y, and z. Why y isn't treated as x and z? #include <stdio.h> #include <string.h> int main() { char result[100] = "Philippe Dupont 30"; char x[50]; char y[50]; int z; /*We use sscanf to give a value …

Member Avatar for kouty
0
1K
Member Avatar for JohnMcPherson

Hello, am working on a program for the U.S. Department of Labor. I am working on two programs for the state of Oregon, and the program that reads data and displays on a screen is working correctly. The code reads tax rates for a specific tax schedule and puts htam …

Member Avatar for abbott@lantic
0
337
Member Avatar for shakin

** # import a data table with space? # ** Good day! I need to read in all the data in a file within column two and export it in a file. The issue is the data is not standard and has blank fields from time to time. It also …

Member Avatar for N1GHTS
0
255
Member Avatar for Prisms

Hello everyone I'm having a bit of trouble with C. Its been awhile and I was wondering if I'm on the right track I'm trying to read from a file and manipulate the data with a structure I created. The problem is the first two values in the text document …

Member Avatar for WaltP
0
406
Member Avatar for OrangeTree

Hi :). I don't found good examples for function sscanf(). Can you help me please with this situation? #include <cstdio> #include <iostream> using namepsace std; int main(int argc, char const *argv[]) { string way = "main/articles/animals/giraffe"; char arr[256]; char arr2[256]; sscanf(way.c_str(), "%[^'/']/", arr); cout << arr << endl; return 0; …

Member Avatar for OrangeTree
0
241
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 mick3339

I am trying to read a csv file and store it into a 2D array, However it give me "segmentation fault" each time I run it. Here is my code [CODE] #include <stdlib.h> int main(void) { const char filename[] = "a.txt"; FILE *file = fopen(filename, "r"); if ( file != …

Member Avatar for Salem
0
484

The End.