[Solved] Linked List pointers prob

[ad_1] There are several issues: Instead of calling initialisation(&LBO); which is not really wrong, just write: LBO = NULL; Then don’t hide pointers with typedefs, it only adds confusion. Instead of: typedef struct noeud { int adresse, taille, temp; struct noeud* suivant; } *liste; Write: struct noeud { int adresse, taille, temp; struct noeud* suivant; … Read more

[Solved] Regex to allow PhoneNumber with country code

[ad_1] \+\d{1,4}-(?!0)\d{1,10}\b Breakdown: \+ Match a literal + \d{1,4} Match between 1 and 4 digits inclusive – Match a literal – (?! Negative lookahead, fail if 0 this token (literal 0) is found ) \d{1,10} Match between 1 and 10 digits inclusive \b Match a word boundary Demo (with your examples) var phoneRegexp = /\+\d{1,4}-(?!0)\d{1,10}\b/g, … Read more

[Solved] How to optimize redundant code in c#?

[ad_1] It is not possible to put generic constraint about specific constructor availabilty, so you cannot guarantee inside the method that TDal _dal = new TDal(_connectionString); is possible. I would refactor it then to provide dal externally: public List<TRule> getData<TRule>(TRule perRA, IDal<TRule> dalRA, int acao) { List<TRule> list = new List<TRule>(); try { list = … Read more

[Solved] what is the method equivalent to push_back (C++) in java?

[ad_1] Answering the question in the title line: If you use java.util.Vector<E>, then it is addElement. Those would be the closest-match class and method in Java to the C++ template classes that you mentioned in your question. Docs are here: https://docs.oracle.com/javase/8/docs/api/java/util/Vector.html#addElement-E- 2 [ad_2] solved what is the method equivalent to push_back (C++) in java?

[Solved] segmentation fault filing sleep function

[ad_1] The else branch of the if(fsize==0) conditional in csvwrite() does not fclose(fe). There is a limit on the number of files that can be opened by any one process at once; if you call this enough times, you’ll hit the limit, and the next fopen() will return NULL (and errno will be set to … Read more

[Solved] error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token

[ad_1] You are trying to compile C++ code as C. C and C++ are different languages, and your C compiler is complaining about C++-specific syntax. Try compiling the code as C++. For most compilers it should be sufficient to rename your file main.cpp. 1 [ad_2] solved error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before … Read more

[Solved] The C Programming Language (second edition): Exercise 1-15 (Celsius to Fahrenheit conversion) – What is wrong with my solution? [duplicate]

[ad_1] The C Programming Language (second edition): Exercise 1-15 (Celsius to Fahrenheit conversion) – What is wrong with my solution? [duplicate] [ad_2] solved The C Programming Language (second edition): Exercise 1-15 (Celsius to Fahrenheit conversion) – What is wrong with my solution? [duplicate]

[Solved] How to create PictureBoxes with shapes based on a Picture

[ad_1] My solution to this is a new class: class ShapedPictureBox : PictureBox { public ShapedPictureBox() { } public Color transparentColor = Color.White; public void updateShape() { if(this.Image = null) return; Bitmap bitmap = new Bitmap(this.Image); System.Drawing.Drawing2D.GraphicsPath graphicsPath = new System.Drawing.Drawing2D.GraphicsPath(); for(int x = 0; x < this.Image.Width; x++) for(int y = 0; y < … Read more

[Solved] How to serialize and deserialize a C# array of integers? [closed]

[ad_1] Assuming your array is an array of Int32… using (var stream = File.Create(“file.xml”)) { var serializer = new XmlSerializer(typeof(Int32[])); serializer.Serialize(stream, someArrayOfInt32); } Will create a simple XML file that is very easy to understand/modify. To deserialize it, use the Deserialize method. In JSON format : using System; using System.Collections.Generic; using System.Linq; using System.Web; using … Read more

[Solved] How to use a CMD command in c++?

[ad_1] “what should i do?” You simply do this (using the std::system() function): #include <cstdlib> // … if(i == 1) { std::system(“ROBOCOPY D:/folder1 D:/folder2 /S /E”); } else if(i == 2) { std::system(“ROBOCOPY D:/folder3 D:/folder4 /S /E”); } Note that for string literals like “D:\folder3”, you’ll need to escape ‘\’ characters, with another ‘\’: “D:\\folder3”. … Read more